Skip to content

Commit 741c145

Browse files
committed
Remove hack to account for the pytests directory
API repos use a non-standard directory to store tests (`pytests`), because of this, the directory should be configured in `pyproject.toml` and since we auto-discover test directories from there, there is no need to keep the hack that will add `pytests` to the `extra_paths` for API repos. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 415d9f6 commit 741c145

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
## Upgrading
88

9+
- nox: Now the default configuration for API repositories will not automatically add `pytests` as an `extra_path`
10+
11+
The `pytests` directory is not a standard directory that will be auto-discovered by `pytest`, so it should always be included in the `pyproject.toml` file, in the `tool.pytest.ini_options.testpaths` array. Please check your API project is properly configured.
12+
913
### Cookiecutter template
1014

1115
- To make the new workflow to check if release notes were updated you should add the check to the branch protection rules of your repository to require this check to pass. You should also add a new label *"cmd:skip-release-notes"* to be able to override the check. You can use the following script to do it:

src/frequenz/repo/config/nox/default.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"""
2626

2727
from . import config as _config
28-
from . import util as _util
2928

3029
common_command_options: _config.CommandsOptions = _config.CommandsOptions(
3130
black=[
@@ -89,16 +88,11 @@
8988
"""Default configuration for APIs.
9089
9190
Same as `common_config`, but with an empty `source_paths` (as the sources are
92-
automatically generated, we don't want to test anything in there) and replacing `"src"`
93-
with `"py"` and `extra_paths` replacing `"tests"` with `"pytests"`.
91+
automatically generated, we don't want to test anything in there).
9492
"""
9593

9694
# We don't check the sources at all because they are automatically generated.
9795
api_config.source_paths = []
98-
# We adapt the path to the tests.
99-
api_config.extra_paths = list(
100-
_util.replace(common_config.extra_paths, {"tests": "pytests"})
101-
)
10296

10397
app_command_options: _config.CommandsOptions = common_command_options.copy()
10498
"""Default command-line options for applications."""

0 commit comments

Comments
 (0)