File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
pylint/testutils/functional Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def _get_files_from_dir(
75
75
files_without_leading_underscore = list (
76
76
p
77
77
for p in path .iterdir ()
78
- if not p .stem .startswith ("_" ) and p .suffix == ".py"
78
+ if not ( p .stem .startswith ("_" ) or ( p . is_file () and p .suffix != ".py" ))
79
79
)
80
80
if len (files_without_leading_underscore ) > max_file_per_directory :
81
81
violations .append ((path , len (files_without_leading_underscore )))
@@ -90,7 +90,6 @@ def walk(path: Path) -> Iterator[Path]:
90
90
)
91
91
for _file_or_dir in parent_dir_files :
92
92
if _file_or_dir .is_dir ():
93
- _files = _get_files_from_dir (_file_or_dir , violations )
94
93
yield _file_or_dir .resolve ()
95
94
try :
96
95
yield from walk (_file_or_dir )
Original file line number Diff line number Diff line change @@ -85,13 +85,13 @@ def test_get_functional_test_files_from_crowded_directory() -> None:
85
85
get_functional_test_files_from_directory (
86
86
DATA_DIRECTORY / "m" , max_file_per_directory = 1
87
87
)
88
- assert exc_info .match ("m: 4 when the max is 1" )
89
- assert exc_info .match ("max_overflow: 3 when the max is 1" )
88
+ assert exc_info .match ("m: 3 when the max is 1" )
89
+ assert exc_info .match ("max_overflow: 2 when the max is 1" )
90
90
with pytest .raises (AssertionError ) as exc_info :
91
91
get_functional_test_files_from_directory (
92
- DATA_DIRECTORY / "m" , max_file_per_directory = 3
92
+ DATA_DIRECTORY / "m" , max_file_per_directory = 2
93
93
)
94
- assert exc_info .match ("m: 4 when the max is 3 " )
94
+ assert exc_info .match ("m: 3 when the max is 2 " )
95
95
assert "max_overflow" not in str (exc_info .value )
96
96
97
97
You can’t perform that action at this time.
0 commit comments