diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-03-24 22:24:37 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-03-28 21:48:17 +0200 |
commit | 178c7c63fa0625e70119983daca95b809e97289a (patch) | |
tree | 959014665e981062e3b8aa82c6b099f8b73ffa30 /tests/testutils | |
parent | bb069b8b2841f190124248f19b11a4258dab4c4f (diff) | |
download | pylint-git-178c7c63fa0625e70119983daca95b809e97289a.tar.gz |
[testutil] Do not count files with leading underscores
Diffstat (limited to 'tests/testutils')
-rw-r--r-- | tests/testutils/test_functional_testutils.py | 9 | ||||
-rw-r--r-- | tests/testutils/test_lint_module_output_update.py | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/testutils/test_functional_testutils.py b/tests/testutils/test_functional_testutils.py index 16732df16..d4a7a0ce1 100644 --- a/tests/testutils/test_functional_testutils.py +++ b/tests/testutils/test_functional_testutils.py @@ -48,8 +48,7 @@ def test_get_functional_test_files_from_directory() -> None: "using_dir.py should go in a directory that starts with the " "first letters of 'using_dir'" ) - with pytest.raises(AssertionError): - exc_info.match("incredibly_bold_mischief.py") + assert "incredibly_bold_mischief.py" not in str(exc_info.value) # Leading underscore mean that this should not fail the assertion get_functional_test_files_from_directory(DATA_DIRECTORY / "u/_no_issue_here") @@ -64,10 +63,10 @@ def test_get_functional_test_files_from_crowded_directory() -> None: 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 + DATA_DIRECTORY / "m", max_file_per_directory=3 ) - assert exc_info.match("m: 4 when the max is 2") - assert exc_info.match("max_overflow: 3 when the max is 2") + assert exc_info.match("m: 4 when the max is 3") + assert "max_overflow" not in str(exc_info.value) def test_minimal_messages_config_enabled(pytest_config: MagicMock) -> None: diff --git a/tests/testutils/test_lint_module_output_update.py b/tests/testutils/test_lint_module_output_update.py index 4874c9713..04c51d884 100644 --- a/tests/testutils/test_lint_module_output_update.py +++ b/tests/testutils/test_lint_module_output_update.py @@ -18,7 +18,6 @@ from pylint.testutils.functional import LintModuleOutputUpdate FIXTURE_DIRECTORY = Path(__file__).parent / "data/functional" DIRECTORIES = list(FIXTURE_DIRECTORY.iterdir()) -DIRECTORIES_NAMES = [d.name for d in DIRECTORIES] @pytest.fixture() @@ -88,7 +87,9 @@ def test_lint_module_output_update_remove_useless_txt( not PY38_PLUS or (IS_PYPY and not PY39_PLUS), reason="Requires accurate 'end_col' value to update output", ) -@pytest.mark.parametrize("directory_path", DIRECTORIES, ids=DIRECTORIES_NAMES) +@pytest.mark.parametrize( + "directory_path", DIRECTORIES, ids=[str(p) for p in DIRECTORIES] +) def test_update_of_functional_output(directory_path: Path, tmp_path: Path) -> None: """Functional test for the functional tests' helper.""" |