Skip to content

Commit b8ee525

Browse files
authored
docs: Hide conftest at any level (#170)
Now that `conftest` to test examples can live at a higher level in the directory structure it is better to ignore any `conftest` module, even if there is a slim chance that anyone could have a `conftest` module that should be part of the public interface (which will conflict with `pytest` anyway).
2 parents a946e61 + 4032da7 commit b8ee525

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ If upgrading `pylint` you might get a few new check errors.
1111
### Cookiecutter template
1212

1313
There is no need to regenerate any templates with this release.
14+
15+
## Bug Fixes
16+
17+
- `mkdocs`: The `conftest` module is now properly hidden from the documentation again.

src/frequenz/repo/config/mkdocs/api_pages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _is_internal(path_parts: Tuple[str, ...]) -> bool:
3535
def with_underscore_not_init(part: str) -> bool:
3636
return part.startswith("_") and part != "__init__"
3737

38-
is_conftest = len(path_parts) == 1 and path_parts[0] == "conftest"
38+
is_conftest = path_parts[-1] == "conftest" if path_parts else False
3939

4040
return is_conftest or any(p for p in path_parts if with_underscore_not_init(p))
4141

0 commit comments

Comments
 (0)