diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-11-28 13:03:13 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-12-03 18:38:20 +0100 |
commit | c209dc0d31ca9e244eda1e7b0f29be6663a9983a (patch) | |
tree | 3466e17085ad9597f6e26efb687a88ec5d447765 | |
parent | ed55e8f66407f1b84a386446372f12feee3230c7 (diff) | |
download | pylint-git-c209dc0d31ca9e244eda1e7b0f29be6663a9983a.tar.gz |
Add a path argument to get_tests for functional tests
-rw-r--r-- | tests/test_functional.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_functional.py b/tests/test_functional.py index 6f0eceb23..e1de53914 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -25,7 +25,8 @@ import csv import os import sys -from typing import Union +from pathlib import Path +from typing import List, Union import pytest from _pytest.config import Config @@ -64,8 +65,7 @@ class LintModuleOutputUpdate(testutils.LintModuleTest): writer.writerow(line.to_csv()) -def get_tests(): - input_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "functional") +def get_tests(input_dir: Union[Path, str]) -> List[FunctionalTestFile]: suite = [] for dirpath, _, filenames in os.walk(input_dir): if dirpath.endswith("__pycache__"): @@ -85,7 +85,9 @@ def get_tests(): return suite -TESTS = get_tests() +TESTS = get_tests( + os.path.join(os.path.dirname(os.path.abspath(__file__)), "functional") +) TESTS_NAMES = [t.base for t in TESTS] TEST_WITH_EXPECTED_DEPRECATION = [ "future_unicode_literals", |