diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-03-23 14:47:29 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-03-28 21:48:17 +0200 |
commit | 2f463663b9b30c5cb1e302e80ea541eded359d96 (patch) | |
tree | de468620988801ad82811dff4d2387de01081bde /tests/testutils | |
parent | 1343dd3f84e62873a40c6fa5bc8b8ba8a6f06d06 (diff) | |
download | pylint-git-2f463663b9b30c5cb1e302e80ea541eded359d96.tar.gz |
[testutil] Display recursive call for crowded functional test dir
Diffstat (limited to 'tests/testutils')
4 files changed, 16 insertions, 0 deletions
diff --git a/tests/testutils/data/m/max_overflow/max_overflow_1.py b/tests/testutils/data/m/max_overflow/max_overflow_1.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/testutils/data/m/max_overflow/max_overflow_1.py diff --git a/tests/testutils/data/m/max_overflow/max_overflow_2.py b/tests/testutils/data/m/max_overflow/max_overflow_2.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/testutils/data/m/max_overflow/max_overflow_2.py diff --git a/tests/testutils/data/m/max_overflow/max_overflow_3.py b/tests/testutils/data/m/max_overflow/max_overflow_3.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/testutils/data/m/max_overflow/max_overflow_3.py diff --git a/tests/testutils/test_functional_testutils.py b/tests/testutils/test_functional_testutils.py index 6019cceac..16732df16 100644 --- a/tests/testutils/test_functional_testutils.py +++ b/tests/testutils/test_functional_testutils.py @@ -54,6 +54,22 @@ def test_get_functional_test_files_from_directory() -> None: get_functional_test_files_from_directory(DATA_DIRECTORY / "u/_no_issue_here") +def test_get_functional_test_files_from_crowded_directory() -> None: + """Test that we correctly check the functional test directory structures.""" + with pytest.raises(AssertionError) as exc_info: + get_functional_test_files_from_directory( + DATA_DIRECTORY / "m", max_file_per_directory=1 + ) + assert exc_info.match("m: 4 when the max is 1") + assert exc_info.match("max_overflow: 3 when the max is 1") + with pytest.raises(AssertionError) as exc_info: + get_functional_test_files_from_directory( + DATA_DIRECTORY / "m", max_file_per_directory=2 + ) + assert exc_info.match("m: 4 when the max is 2") + assert exc_info.match("max_overflow: 3 when the max is 2") + + def test_minimal_messages_config_enabled(pytest_config: MagicMock) -> None: """Test that all messages not targeted in the functional test are disabled when running with --minimal-messages-config. |