summaryrefslogtreecommitdiff
path: root/tests/testutils
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2023-03-23 14:07:20 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2023-03-28 21:48:17 +0200
commit731746365b28a406faaa3aff406eb81c92faefc9 (patch)
tree8ece7fa73eb5ecd3274edc393b9d6b2d2b84fef4 /tests/testutils
parent1dcb7becadecda6b2e7b0af022a8ec6d1a1d9d22 (diff)
downloadpylint-git-731746365b28a406faaa3aff406eb81c92faefc9.tar.gz
[testutil] Fix the algorithm for functional test discovery
Diffstat (limited to 'tests/testutils')
-rw-r--r--tests/testutils/data/u/_no_issue_here/_incredibly_bold_mischief.py0
-rw-r--r--tests/testutils/test_functional_testutils.py11
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/testutils/data/u/_no_issue_here/_incredibly_bold_mischief.py b/tests/testutils/data/u/_no_issue_here/_incredibly_bold_mischief.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/testutils/data/u/_no_issue_here/_incredibly_bold_mischief.py
diff --git a/tests/testutils/test_functional_testutils.py b/tests/testutils/test_functional_testutils.py
index e12fd7a84..6019cceac 100644
--- a/tests/testutils/test_functional_testutils.py
+++ b/tests/testutils/test_functional_testutils.py
@@ -41,12 +41,17 @@ def test_parsing_of_pylintrc_init_hook() -> None:
def test_get_functional_test_files_from_directory() -> None:
"""Test that we correctly check the functional test directory structures."""
- match = (
+ with pytest.raises(AssertionError) as exc_info:
+ get_functional_test_files_from_directory(DATA_DIRECTORY / "u")
+ assert exc_info.match("'use_dir.py' should go in 'use'")
+ assert exc_info.match(
"using_dir.py should go in a directory that starts with the "
"first letters of 'using_dir'"
)
- with pytest.raises(AssertionError, match=match):
- get_functional_test_files_from_directory(DATA_DIRECTORY / "u")
+ with pytest.raises(AssertionError):
+ exc_info.match("incredibly_bold_mischief.py")
+ # Leading underscore mean that this should not fail the assertion
+ get_functional_test_files_from_directory(DATA_DIRECTORY / "u/_no_issue_here")
def test_minimal_messages_config_enabled(pytest_config: MagicMock) -> None: