Skip to content

[R-package] consolidate testing constants in helpers file - #5992

Merged
jameslamb merged 3 commits into
masterfrom
r/test-helpers
Jul 21, 2023
Merged

jameslamb merged 3 commits into
masterfrom
r/test-helpers

Conversation

@jameslamb

Copy link
Copy Markdown
Member

Working on #5988, I learned about the helpers.R mechanism in {testthat}.

That file is sourced before each test file is run (sort of like a conftest.py with pytest in Python). This PR proposes consolidating some constants that are duplicated across all the tests files into that file, to reduce duplication and encourage consistency across the tests.

For details on how {testthat} treats that file specially, see https://r-pkgs.org/testing-design.html#testthat-helper-files.

file that is always executed by load_all() and at the beginning of automated testing is a helper file, defined as any file below tests/testthat/ that begins with helper.

@jameslamb
jameslamb merged commit 44928d3 into master Jul 21, 2023
@jameslamb
jameslamb deleted the r/test-helpers branch July 21, 2023 15:15
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants