Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Feb 1, 2022
1 parent 157506f commit 9a75391
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 4 additions & 5 deletions pylint/testutils/functional/find_functional_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ def get_functional_test_files_from_directory(
for dirpath, dirnames, filenames in os.walk(input_dir):
if dirpath.endswith("__pycache__"):
continue
if Path(dirpath).stem.startswith("_"):
break
_test_structure_of_dir(Path(dirpath))
check_functional_tests_structure(
dirpath,
dirnames,
Expand All @@ -40,7 +37,7 @@ def get_functional_test_files_from_directory(

def check_functional_tests_structure(
dirpath: str,
dirnames: List[str],
dirnames: List[str], # pylint: disable=unused-argument
filenames: List[str],
input_dir: str,
reasonably_displayable_vertically: int,
Expand All @@ -50,8 +47,10 @@ def check_functional_tests_structure(
), f"{dirpath} contains too many functional tests files."
if dirpath == input_dir:
return
if Path(dirpath).stem.startswith("_"):
return
_test_structure_of_dir(Path(dirpath))
last_dir_name = dirpath.split("/")[-1].lstrip()
print(f"{dirpath=} {dirnames=} {filenames=} {last_dir_name=}")
for filename in filenames:
if filename.startswith("__"):
return
Expand Down
9 changes: 2 additions & 7 deletions tests/testutils/test_functional_testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,5 @@ def test_parsing_of_pylintrc_init_hook() -> None:


def test_get_functional_test_files_from_directory() -> None:
assert len(get_functional_test_files_from_directory(DATA_DIRECTORY)) == 5


def test_get_functional_test_files_from_subdirectory() -> None:
assert (
len(get_functional_test_files_from_directory(DATA_DIRECTORY / "u" / "use")) == 2
)
with pytest.raises(AssertionError, match="using_dir.py should not go in"):
get_functional_test_files_from_directory(DATA_DIRECTORY)

0 comments on commit 9a75391

Please sign in to comment.