diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-11-28 13:06:29 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-12-03 18:38:20 +0100 |
commit | e38dfbbf597a25d9f5f96e5c9030cf43ef58257e (patch) | |
tree | 0ba4cad8aa6c64e0eb138dcc5cbb7f2d085e3176 | |
parent | c209dc0d31ca9e244eda1e7b0f29be6663a9983a (diff) | |
download | pylint-git-e38dfbbf597a25d9f5f96e5c9030cf43ef58257e.tar.gz |
Rename get_tests to get_functional_test_files_from_directory
And use Path instead of os
-rw-r--r-- | tests/test_functional.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_functional.py b/tests/test_functional.py index e1de53914..c0badfbe3 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -43,6 +43,7 @@ from pylint.utils import HAS_ISORT_5 # 'Wet finger' number of files that are reasonable to display by an IDE # 'Wet finger' as in 'in my settings there are precisely this many'. REASONABLY_DISPLAYABLE_VERTICALLY = 48 +FUNCTIONAL_DIR = Path(__file__).parent.resolve() / "functional" class LintModuleOutputUpdate(testutils.LintModuleTest): @@ -65,7 +66,9 @@ class LintModuleOutputUpdate(testutils.LintModuleTest): writer.writerow(line.to_csv()) -def get_tests(input_dir: Union[Path, str]) -> List[FunctionalTestFile]: +def get_functional_test_files_from_directory( + input_dir: Union[Path, str] +) -> List[FunctionalTestFile]: suite = [] for dirpath, _, filenames in os.walk(input_dir): if dirpath.endswith("__pycache__"): @@ -85,9 +88,7 @@ def get_tests(input_dir: Union[Path, str]) -> List[FunctionalTestFile]: return suite -TESTS = get_tests( - os.path.join(os.path.dirname(os.path.abspath(__file__)), "functional") -) +TESTS = get_functional_test_files_from_directory(FUNCTIONAL_DIR) TESTS_NAMES = [t.base for t in TESTS] TEST_WITH_EXPECTED_DEPRECATION = [ "future_unicode_literals", |