diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-04-28 10:42:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 10:42:56 +0200 |
commit | 215bdf12f61b4e5ebc5e2b745a84f7c665491f90 (patch) | |
tree | bf5e842e2be3ce39fb2091e1c9b4683f0b862ead /doc/test_messages_documentation.py | |
parent | 0e35511ea2f55da8eaa3272468f320195b5f8006 (diff) | |
download | pylint-git-215bdf12f61b4e5ebc5e2b745a84f7c665491f90.tar.gz |
Add an assertion to check that the documentation structure is correct (#6466)
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'doc/test_messages_documentation.py')
-rw-r--r-- | doc/test_messages_documentation.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/test_messages_documentation.py b/doc/test_messages_documentation.py index 36de80d54..9faa834f0 100644 --- a/doc/test_messages_documentation.py +++ b/doc/test_messages_documentation.py @@ -2,7 +2,7 @@ # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt -"""Functional tests for the code examples in the messages documentation.""" +"""Functional tests for the code examples in the messages' documentation.""" import sys @@ -41,6 +41,11 @@ def get_functional_test_files_from_directory(input_dir: Path) -> List[Tuple[str, for subdirectory in input_dir.iterdir(): for message_dir in subdirectory.iterdir(): + assert_msg = ( + f"{subdirectory}: '{message_dir.name}' is in the wrong " + f"directory: it does not start with '{subdirectory.name}'" + ) + assert message_dir.name.startswith(subdirectory.name), assert_msg if (message_dir / "good.py").exists(): suite.append( (message_dir.stem, message_dir / "good.py"), |