diff --git a/pylint/testutils/functional/find_functional_tests.py b/pylint/testutils/functional/find_functional_tests.py index 610b05db1a..cddf0ade73 100644 --- a/pylint/testutils/functional/find_functional_tests.py +++ b/pylint/testutils/functional/find_functional_tests.py @@ -3,13 +3,29 @@ import os from pathlib import Path -from typing import List, Union +from typing import List, Set, Union from pylint.testutils.functional.test_file import FunctionalTestFile -# '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 +"""'Wet finger' number of files that are reasonable to display by an IDE.""" +SHOULD_BE_IN_THE_SAME_DIRECTORY = 5 +"""'Wet finger' as in 'in my settings there are precisely this many'.""" + +IGNORED_PARENT_DIRS = { + "deprecated_relative_import", + "ext", + "regression", + "regression_02", +} +"""Direct parent directories that should be ignored.""" + +IGNORED_PARENT_PARENT_DIRS = { + "docparams", + "deprecated_relative_import", + "ext", +} +"""Parents of direct parent directories that should be ignored.""" def get_functional_test_files_from_directory( @@ -17,15 +33,51 @@ def get_functional_test_files_from_directory( ) -> List[FunctionalTestFile]: """Get all functional tests in the input_dir.""" suite = [] + + _check_functional_tests_structure(Path(input_dir)) + for dirpath, _, filenames in os.walk(input_dir): if dirpath.endswith("__pycache__"): continue - - assert ( - len(filenames) <= REASONABLY_DISPLAYABLE_VERTICALLY - ), f"{dirpath} contains too many functional tests files." - for filename in filenames: if filename != "__init__.py" and filename.endswith(".py"): suite.append(FunctionalTestFile(dirpath, filename)) return suite + + +def _check_functional_tests_structure(directory: Path) -> None: + """Check if test directories follow correct file/folder structure.""" + # Ignore underscored directories + if Path(directory).stem.startswith("_"): + return + + files: Set[Path] = set() + dirs: Set[Path] = set() + + # Collect all subdirectories and files in directory + for file_or_dir in directory.iterdir(): + if file_or_dir.is_file(): + if file_or_dir.suffix == ".py" and not file_or_dir.stem.startswith("_"): + files.add(file_or_dir) + elif file_or_dir.is_dir(): + dirs.add(file_or_dir) + _check_functional_tests_structure(file_or_dir) + + assert len(files) <= REASONABLY_DISPLAYABLE_VERTICALLY, ( + f"{directory} contains too many functional tests files " + + f"({len(files)} > {REASONABLY_DISPLAYABLE_VERTICALLY})." + ) + + for file in files: + possible_dir = file.parent / file.stem.split("_")[0] + assert not possible_dir.exists(), f"{file} should go in {possible_dir}." + + # Exclude some directories as they follow a different structure + if ( + not len(file.parent.stem) == 1 # First letter subdirectories + and file.parent.stem not in IGNORED_PARENT_DIRS + and file.parent.parent.stem not in IGNORED_PARENT_PARENT_DIRS + ): + assert file.stem.startswith( + file.parent.stem + ), f"{file} should not go in {file.parent}" diff --git a/tests/functional/a/assign/assign_to_new_keyword.py b/tests/functional/a/assign_to_new_keyword.py similarity index 100% rename from tests/functional/a/assign/assign_to_new_keyword.py rename to tests/functional/a/assign_to_new_keyword.py diff --git a/tests/functional/a/assign/assign_to_new_keyword.rc b/tests/functional/a/assign_to_new_keyword.rc similarity index 100% rename from tests/functional/a/assign/assign_to_new_keyword.rc rename to tests/functional/a/assign_to_new_keyword.rc diff --git a/tests/functional/a/assign/assign_to_new_keyword.txt b/tests/functional/a/assign_to_new_keyword.txt similarity index 100% rename from tests/functional/a/assign/assign_to_new_keyword.txt rename to tests/functional/a/assign_to_new_keyword.txt diff --git a/tests/functional/a/assign/assigning_non_slot.py b/tests/functional/a/assigning/assigning_non_slot.py similarity index 100% rename from tests/functional/a/assign/assigning_non_slot.py rename to tests/functional/a/assigning/assigning_non_slot.py diff --git a/tests/functional/a/assign/assigning_non_slot.txt b/tests/functional/a/assigning/assigning_non_slot.txt similarity index 100% rename from tests/functional/a/assign/assigning_non_slot.txt rename to tests/functional/a/assigning/assigning_non_slot.txt diff --git a/tests/functional/a/assign/assigning_non_slot_4509.py b/tests/functional/a/assigning/assigning_non_slot_4509.py similarity index 100% rename from tests/functional/a/assign/assigning_non_slot_4509.py rename to tests/functional/a/assigning/assigning_non_slot_4509.py diff --git a/tests/functional/a/assign/assigning_non_slot_4509.rc b/tests/functional/a/assigning/assigning_non_slot_4509.rc similarity index 100% rename from tests/functional/a/assign/assigning_non_slot_4509.rc rename to tests/functional/a/assigning/assigning_non_slot_4509.rc diff --git a/tests/functional/a/assign/assigning_non_slot_4509.txt b/tests/functional/a/assigning/assigning_non_slot_4509.txt similarity index 100% rename from tests/functional/a/assign/assigning_non_slot_4509.txt rename to tests/functional/a/assigning/assigning_non_slot_4509.txt diff --git a/tests/functional/a/assign/assignment_expression.py b/tests/functional/a/assignment/assignment_expression.py similarity index 100% rename from tests/functional/a/assign/assignment_expression.py rename to tests/functional/a/assignment/assignment_expression.py diff --git a/tests/functional/a/assign/assignment_expression.rc b/tests/functional/a/assignment/assignment_expression.rc similarity index 100% rename from tests/functional/a/assign/assignment_expression.rc rename to tests/functional/a/assignment/assignment_expression.rc diff --git a/tests/functional/a/assign/assignment_expression.txt b/tests/functional/a/assignment/assignment_expression.txt similarity index 100% rename from tests/functional/a/assign/assignment_expression.txt rename to tests/functional/a/assignment/assignment_expression.txt diff --git a/tests/functional/a/assign/assignment_from_no_return.py b/tests/functional/a/assignment/assignment_from_no_return.py similarity index 100% rename from tests/functional/a/assign/assignment_from_no_return.py rename to tests/functional/a/assignment/assignment_from_no_return.py diff --git a/tests/functional/a/assign/assignment_from_no_return.txt b/tests/functional/a/assignment/assignment_from_no_return.txt similarity index 100% rename from tests/functional/a/assign/assignment_from_no_return.txt rename to tests/functional/a/assignment/assignment_from_no_return.txt diff --git a/tests/functional/a/assign/assignment_from_no_return_2.py b/tests/functional/a/assignment/assignment_from_no_return_2.py similarity index 100% rename from tests/functional/a/assign/assignment_from_no_return_2.py rename to tests/functional/a/assignment/assignment_from_no_return_2.py diff --git a/tests/functional/a/assign/assignment_from_no_return_2.txt b/tests/functional/a/assignment/assignment_from_no_return_2.txt similarity index 100% rename from tests/functional/a/assign/assignment_from_no_return_2.txt rename to tests/functional/a/assignment/assignment_from_no_return_2.txt diff --git a/tests/functional/a/assign/assignment_from_no_return_py3.py b/tests/functional/a/assignment/assignment_from_no_return_py3.py similarity index 100% rename from tests/functional/a/assign/assignment_from_no_return_py3.py rename to tests/functional/a/assignment/assignment_from_no_return_py3.py diff --git a/tests/functional/d/deprecated/dataclass_typecheck.py b/tests/functional/d/dataclass_typecheck.py similarity index 100% rename from tests/functional/d/deprecated/dataclass_typecheck.py rename to tests/functional/d/dataclass_typecheck.py diff --git a/tests/functional/d/deprecated/dataclass_typecheck.rc b/tests/functional/d/dataclass_typecheck.rc similarity index 100% rename from tests/functional/d/deprecated/dataclass_typecheck.rc rename to tests/functional/d/dataclass_typecheck.rc diff --git a/tests/functional/d/deprecated/dataclass_typecheck.txt b/tests/functional/d/dataclass_typecheck.txt similarity index 100% rename from tests/functional/d/deprecated/dataclass_typecheck.txt rename to tests/functional/d/dataclass_typecheck.txt diff --git a/tests/functional/i/import_error.py b/tests/functional/i/import_error.py index a2183fcfba..2ce63544ba 100644 --- a/tests/functional/i/import_error.py +++ b/tests/functional/i/import_error.py @@ -30,7 +30,7 @@ pass -from functional.s.syntax_error import toto # [no-name-in-module,syntax-error] +from functional.s.syntax.syntax_error import toto # [no-name-in-module,syntax-error] # Don't emit `import-error` or `no-name-in-module` diff --git a/tests/functional/i/import_error.txt b/tests/functional/i/import_error.txt index 4e7ab24235..28e94dc72e 100644 --- a/tests/functional/i/import_error.txt +++ b/tests/functional/i/import_error.txt @@ -1,5 +1,5 @@ import-error:3:0:3:22::Unable to import 'totally_missing':UNDEFINED import-error:21:4:21:26::Unable to import 'maybe_missing_2':UNDEFINED -no-name-in-module:33:0:33:42::No name 'syntax_error' in module 'functional.s':UNDEFINED -syntax-error:33:0:None:None::Cannot import 'functional.s.syntax_error' due to syntax error 'invalid syntax (, line 1)':UNDEFINED +no-name-in-module:33:0:33:49::No name 'syntax_error' in module 'functional.s.syntax':UNDEFINED +syntax-error:33:0:None:None::Cannot import 'functional.s.syntax.syntax_error' due to syntax error 'invalid syntax (, line 1)':UNDEFINED multiple-imports:78:0:78:15::Multiple imports on one line (foo, bar):UNDEFINED diff --git a/tests/functional/i/invalid/b/invalid_bool_returned.py b/tests/functional/i/invalid/invalid_bool_returned.py similarity index 100% rename from tests/functional/i/invalid/b/invalid_bool_returned.py rename to tests/functional/i/invalid/invalid_bool_returned.py diff --git a/tests/functional/i/invalid/b/invalid_bool_returned.txt b/tests/functional/i/invalid/invalid_bool_returned.txt similarity index 100% rename from tests/functional/i/invalid/b/invalid_bool_returned.txt rename to tests/functional/i/invalid/invalid_bool_returned.txt diff --git a/tests/functional/i/invalid/b/invalid_bytes_returned.py b/tests/functional/i/invalid/invalid_bytes_returned.py similarity index 100% rename from tests/functional/i/invalid/b/invalid_bytes_returned.py rename to tests/functional/i/invalid/invalid_bytes_returned.py diff --git a/tests/functional/i/invalid/b/invalid_bytes_returned.txt b/tests/functional/i/invalid/invalid_bytes_returned.txt similarity index 100% rename from tests/functional/i/invalid/b/invalid_bytes_returned.txt rename to tests/functional/i/invalid/invalid_bytes_returned.txt diff --git a/tests/functional/i/invalid/e/invalid_envvar_value.py b/tests/functional/i/invalid/invalid_envvar_value.py similarity index 100% rename from tests/functional/i/invalid/e/invalid_envvar_value.py rename to tests/functional/i/invalid/invalid_envvar_value.py diff --git a/tests/functional/i/invalid/e/invalid_envvar_value.txt b/tests/functional/i/invalid/invalid_envvar_value.txt similarity index 100% rename from tests/functional/i/invalid/e/invalid_envvar_value.txt rename to tests/functional/i/invalid/invalid_envvar_value.txt diff --git a/tests/functional/i/invalid/e/invalid_exceptions_caught.py b/tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_caught.py similarity index 100% rename from tests/functional/i/invalid/e/invalid_exceptions_caught.py rename to tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_caught.py diff --git a/tests/functional/i/invalid/e/invalid_exceptions_caught.rc b/tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_caught.rc similarity index 100% rename from tests/functional/i/invalid/e/invalid_exceptions_caught.rc rename to tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_caught.rc diff --git a/tests/functional/i/invalid/e/invalid_exceptions_caught.txt b/tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_caught.txt similarity index 100% rename from tests/functional/i/invalid/e/invalid_exceptions_caught.txt rename to tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_caught.txt diff --git a/tests/functional/i/invalid/e/invalid_exceptions_raised.py b/tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_raised.py similarity index 100% rename from tests/functional/i/invalid/e/invalid_exceptions_raised.py rename to tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_raised.py diff --git a/tests/functional/i/invalid/e/invalid_exceptions_raised.txt b/tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_raised.txt similarity index 100% rename from tests/functional/i/invalid/e/invalid_exceptions_raised.txt rename to tests/functional/i/invalid/invalid_exceptions/invalid_exceptions_raised.txt diff --git a/tests/functional/i/invalid/g/invalid_getnewargs_ex_returned.py b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.py similarity index 100% rename from tests/functional/i/invalid/g/invalid_getnewargs_ex_returned.py rename to tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.py diff --git a/tests/functional/i/invalid/g/invalid_getnewargs_ex_returned.txt b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.txt similarity index 100% rename from tests/functional/i/invalid/g/invalid_getnewargs_ex_returned.txt rename to tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_ex_returned.txt diff --git a/tests/functional/i/invalid/g/invalid_getnewargs_returned.py b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.py similarity index 100% rename from tests/functional/i/invalid/g/invalid_getnewargs_returned.py rename to tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.py diff --git a/tests/functional/i/invalid/g/invalid_getnewargs_returned.txt b/tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.txt similarity index 100% rename from tests/functional/i/invalid/g/invalid_getnewargs_returned.txt rename to tests/functional/i/invalid/invalid_getnewargs/invalid_getnewargs_returned.txt diff --git a/tests/functional/i/invalid/l/invalid_length_hint_returned.py b/tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.py similarity index 100% rename from tests/functional/i/invalid/l/invalid_length_hint_returned.py rename to tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.py diff --git a/tests/functional/i/invalid/l/invalid_length_hint_returned.txt b/tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.txt similarity index 100% rename from tests/functional/i/invalid/l/invalid_length_hint_returned.txt rename to tests/functional/i/invalid/invalid_length/invalid_length_hint_returned.txt diff --git a/tests/functional/i/invalid/l/invalid_length_returned.py b/tests/functional/i/invalid/invalid_length/invalid_length_returned.py similarity index 100% rename from tests/functional/i/invalid/l/invalid_length_returned.py rename to tests/functional/i/invalid/invalid_length/invalid_length_returned.py diff --git a/tests/functional/i/invalid/l/invalid_length_returned.txt b/tests/functional/i/invalid/invalid_length/invalid_length_returned.txt similarity index 100% rename from tests/functional/i/invalid/l/invalid_length_returned.txt rename to tests/functional/i/invalid/invalid_length/invalid_length_returned.txt diff --git a/tests/functional/i/invalid/m/invalid_metaclass.py b/tests/functional/i/invalid/invalid_metaclass.py similarity index 100% rename from tests/functional/i/invalid/m/invalid_metaclass.py rename to tests/functional/i/invalid/invalid_metaclass.py diff --git a/tests/functional/i/invalid/m/invalid_metaclass.txt b/tests/functional/i/invalid/invalid_metaclass.txt similarity index 100% rename from tests/functional/i/invalid/m/invalid_metaclass.txt rename to tests/functional/i/invalid/invalid_metaclass.txt diff --git a/tests/functional/i/invalid/m/invalid_metaclass_py3.py b/tests/functional/i/invalid/invalid_metaclass_py3.py similarity index 100% rename from tests/functional/i/invalid/m/invalid_metaclass_py3.py rename to tests/functional/i/invalid/invalid_metaclass_py3.py diff --git a/tests/functional/i/invalid/invalid_name_issue_3405.py b/tests/functional/i/invalid/invalid_name/invalid_name_issue_3405.py similarity index 100% rename from tests/functional/i/invalid/invalid_name_issue_3405.py rename to tests/functional/i/invalid/invalid_name/invalid_name_issue_3405.py diff --git a/tests/functional/i/invalid/invalid_name_issue_3405.rc b/tests/functional/i/invalid/invalid_name/invalid_name_issue_3405.rc similarity index 100% rename from tests/functional/i/invalid/invalid_name_issue_3405.rc rename to tests/functional/i/invalid/invalid_name/invalid_name_issue_3405.rc diff --git a/tests/functional/i/invalid/invalid_name_issue_3405.txt b/tests/functional/i/invalid/invalid_name/invalid_name_issue_3405.txt similarity index 100% rename from tests/functional/i/invalid/invalid_name_issue_3405.txt rename to tests/functional/i/invalid/invalid_name/invalid_name_issue_3405.txt diff --git a/tests/functional/i/invalid/invalid_name_module_level.py b/tests/functional/i/invalid/invalid_name/invalid_name_module_level.py similarity index 100% rename from tests/functional/i/invalid/invalid_name_module_level.py rename to tests/functional/i/invalid/invalid_name/invalid_name_module_level.py diff --git a/tests/functional/i/invalid/invalid_name_module_level.txt b/tests/functional/i/invalid/invalid_name/invalid_name_module_level.txt similarity index 100% rename from tests/functional/i/invalid/invalid_name_module_level.txt rename to tests/functional/i/invalid/invalid_name/invalid_name_module_level.txt diff --git a/tests/functional/i/invalid/invalid_name_multinaming_style.py b/tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.py similarity index 100% rename from tests/functional/i/invalid/invalid_name_multinaming_style.py rename to tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.py diff --git a/tests/functional/i/invalid/invalid_name_multinaming_style.rc b/tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.rc similarity index 100% rename from tests/functional/i/invalid/invalid_name_multinaming_style.rc rename to tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.rc diff --git a/tests/functional/i/invalid/invalid_name_multinaming_style.txt b/tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.txt similarity index 100% rename from tests/functional/i/invalid/invalid_name_multinaming_style.txt rename to tests/functional/i/invalid/invalid_name/invalid_name_multinaming_style.txt diff --git a/tests/functional/i/invalid/invalid_name_property.py b/tests/functional/i/invalid/invalid_name/invalid_name_property.py similarity index 100% rename from tests/functional/i/invalid/invalid_name_property.py rename to tests/functional/i/invalid/invalid_name/invalid_name_property.py diff --git a/tests/functional/i/invalid/invalid_name_property.rc b/tests/functional/i/invalid/invalid_name/invalid_name_property.rc similarity index 100% rename from tests/functional/i/invalid/invalid_name_property.rc rename to tests/functional/i/invalid/invalid_name/invalid_name_property.rc diff --git a/tests/functional/i/invalid/invalid_name_property.txt b/tests/functional/i/invalid/invalid_name/invalid_name_property.txt similarity index 100% rename from tests/functional/i/invalid/invalid_name_property.txt rename to tests/functional/i/invalid/invalid_name/invalid_name_property.txt diff --git a/tests/functional/i/invalid/s/invalid_sequence_index.py b/tests/functional/i/invalid/invalid_sequence_index.py similarity index 100% rename from tests/functional/i/invalid/s/invalid_sequence_index.py rename to tests/functional/i/invalid/invalid_sequence_index.py diff --git a/tests/functional/i/invalid/s/invalid_sequence_index.txt b/tests/functional/i/invalid/invalid_sequence_index.txt similarity index 100% rename from tests/functional/i/invalid/s/invalid_sequence_index.txt rename to tests/functional/i/invalid/invalid_sequence_index.txt diff --git a/tests/functional/i/invalid/s/invalid_slice_index.py b/tests/functional/i/invalid/invalid_slice_index.py similarity index 100% rename from tests/functional/i/invalid/s/invalid_slice_index.py rename to tests/functional/i/invalid/invalid_slice_index.py diff --git a/tests/functional/i/invalid/s/invalid_slice_index.txt b/tests/functional/i/invalid/invalid_slice_index.txt similarity index 100% rename from tests/functional/i/invalid/s/invalid_slice_index.txt rename to tests/functional/i/invalid/invalid_slice_index.txt diff --git a/tests/functional/i/invalid/s/invalid_star_assignment_target.py b/tests/functional/i/invalid/invalid_star_assignment_target.py similarity index 100% rename from tests/functional/i/invalid/s/invalid_star_assignment_target.py rename to tests/functional/i/invalid/invalid_star_assignment_target.py diff --git a/tests/functional/i/invalid/s/invalid_star_assignment_target.txt b/tests/functional/i/invalid/invalid_star_assignment_target.txt similarity index 100% rename from tests/functional/i/invalid/s/invalid_star_assignment_target.txt rename to tests/functional/i/invalid/invalid_star_assignment_target.txt diff --git a/tests/functional/i/invalid/s/invalid_str_returned.py b/tests/functional/i/invalid/invalid_str_returned.py similarity index 100% rename from tests/functional/i/invalid/s/invalid_str_returned.py rename to tests/functional/i/invalid/invalid_str_returned.py diff --git a/tests/functional/i/invalid/s/invalid_str_returned.txt b/tests/functional/i/invalid/invalid_str_returned.txt similarity index 100% rename from tests/functional/i/invalid/s/invalid_str_returned.txt rename to tests/functional/i/invalid/invalid_str_returned.txt diff --git a/tests/functional/m/member/membership_protocol.py b/tests/functional/m/membership_protocol.py similarity index 100% rename from tests/functional/m/member/membership_protocol.py rename to tests/functional/m/membership_protocol.py diff --git a/tests/functional/m/member/membership_protocol.txt b/tests/functional/m/membership_protocol.txt similarity index 100% rename from tests/functional/m/member/membership_protocol.txt rename to tests/functional/m/membership_protocol.txt diff --git a/tests/functional/m/member/membership_protocol_py3.py b/tests/functional/m/membership_protocol_py3.py similarity index 100% rename from tests/functional/m/member/membership_protocol_py3.py rename to tests/functional/m/membership_protocol_py3.py diff --git a/tests/functional/m/member/membership_protocol_py3.txt b/tests/functional/m/membership_protocol_py3.txt similarity index 100% rename from tests/functional/m/member/membership_protocol_py3.txt rename to tests/functional/m/membership_protocol_py3.txt diff --git a/tests/functional/n/name/namePresetCamelCase.py b/tests/functional/n/namePresetCamelCase.py similarity index 100% rename from tests/functional/n/name/namePresetCamelCase.py rename to tests/functional/n/namePresetCamelCase.py diff --git a/tests/functional/n/name/namePresetCamelCase.rc b/tests/functional/n/namePresetCamelCase.rc similarity index 100% rename from tests/functional/n/name/namePresetCamelCase.rc rename to tests/functional/n/namePresetCamelCase.rc diff --git a/tests/functional/n/name/namePresetCamelCase.txt b/tests/functional/n/namePresetCamelCase.txt similarity index 100% rename from tests/functional/n/name/namePresetCamelCase.txt rename to tests/functional/n/namePresetCamelCase.txt diff --git a/tests/functional/n/name/namedtuple_member_inference.py b/tests/functional/n/namedtuple_member_inference.py similarity index 100% rename from tests/functional/n/name/namedtuple_member_inference.py rename to tests/functional/n/namedtuple_member_inference.py diff --git a/tests/functional/n/name/namedtuple_member_inference.txt b/tests/functional/n/namedtuple_member_inference.txt similarity index 100% rename from tests/functional/n/name/namedtuple_member_inference.txt rename to tests/functional/n/namedtuple_member_inference.txt diff --git a/tests/functional/n/name/names_in__all__.py b/tests/functional/n/names_in__all__.py similarity index 100% rename from tests/functional/n/name/names_in__all__.py rename to tests/functional/n/names_in__all__.py diff --git a/tests/functional/n/name/names_in__all__.txt b/tests/functional/n/names_in__all__.txt similarity index 100% rename from tests/functional/n/name/names_in__all__.txt rename to tests/functional/n/names_in__all__.txt diff --git "a/tests/functional/n/non_ascii_import/non_ascii_name_lo\305\202.py" "b/tests/functional/n/non_ascii_name/non_ascii_name_lo\305\202.py" similarity index 100% rename from "tests/functional/n/non_ascii_import/non_ascii_name_lo\305\202.py" rename to "tests/functional/n/non_ascii_name/non_ascii_name_lo\305\202.py" diff --git "a/tests/functional/n/non_ascii_import/non_ascii_name_lo\305\202.txt" "b/tests/functional/n/non_ascii_name/non_ascii_name_lo\305\202.txt" similarity index 100% rename from "tests/functional/n/non_ascii_import/non_ascii_name_lo\305\202.txt" rename to "tests/functional/n/non_ascii_name/non_ascii_name_lo\305\202.txt" diff --git a/tests/functional/r/raise/raise_missing_from.py b/tests/functional/r/raise_missing_from.py similarity index 100% rename from tests/functional/r/raise/raise_missing_from.py rename to tests/functional/r/raise_missing_from.py diff --git a/tests/functional/r/raise/raise_missing_from.txt b/tests/functional/r/raise_missing_from.txt similarity index 100% rename from tests/functional/r/raise/raise_missing_from.txt rename to tests/functional/r/raise_missing_from.txt diff --git a/tests/functional/r/raise/raising_bad_type.py b/tests/functional/r/raising/raising_bad_type.py similarity index 100% rename from tests/functional/r/raise/raising_bad_type.py rename to tests/functional/r/raising/raising_bad_type.py diff --git a/tests/functional/r/raise/raising_bad_type.txt b/tests/functional/r/raising/raising_bad_type.txt similarity index 100% rename from tests/functional/r/raise/raising_bad_type.txt rename to tests/functional/r/raising/raising_bad_type.txt diff --git a/tests/functional/r/raise/raising_format_tuple.py b/tests/functional/r/raising/raising_format_tuple.py similarity index 100% rename from tests/functional/r/raise/raising_format_tuple.py rename to tests/functional/r/raising/raising_format_tuple.py diff --git a/tests/functional/r/raise/raising_format_tuple.txt b/tests/functional/r/raising/raising_format_tuple.txt similarity index 100% rename from tests/functional/r/raise/raising_format_tuple.txt rename to tests/functional/r/raising/raising_format_tuple.txt diff --git a/tests/functional/r/raise/raising_non_exception.py b/tests/functional/r/raising/raising_non_exception.py similarity index 100% rename from tests/functional/r/raise/raising_non_exception.py rename to tests/functional/r/raising/raising_non_exception.py diff --git a/tests/functional/r/raise/raising_non_exception.txt b/tests/functional/r/raising/raising_non_exception.txt similarity index 100% rename from tests/functional/r/raise/raising_non_exception.txt rename to tests/functional/r/raising/raising_non_exception.txt diff --git a/tests/functional/r/raise/raising_self.py b/tests/functional/r/raising/raising_self.py similarity index 100% rename from tests/functional/r/raise/raising_self.py rename to tests/functional/r/raising/raising_self.py diff --git a/tests/functional/r/redefined_argument_from_local.py b/tests/functional/r/redefined/redefined_argument_from_local.py similarity index 100% rename from tests/functional/r/redefined_argument_from_local.py rename to tests/functional/r/redefined/redefined_argument_from_local.py diff --git a/tests/functional/r/redefined_argument_from_local.txt b/tests/functional/r/redefined/redefined_argument_from_local.txt similarity index 100% rename from tests/functional/r/redefined_argument_from_local.txt rename to tests/functional/r/redefined/redefined_argument_from_local.txt diff --git a/tests/functional/r/redefined_builtin.py b/tests/functional/r/redefined/redefined_builtin.py similarity index 100% rename from tests/functional/r/redefined_builtin.py rename to tests/functional/r/redefined/redefined_builtin.py diff --git a/tests/functional/r/redefined_builtin.rc b/tests/functional/r/redefined/redefined_builtin.rc similarity index 100% rename from tests/functional/r/redefined_builtin.rc rename to tests/functional/r/redefined/redefined_builtin.rc diff --git a/tests/functional/r/redefined_builtin.txt b/tests/functional/r/redefined/redefined_builtin.txt similarity index 100% rename from tests/functional/r/redefined_builtin.txt rename to tests/functional/r/redefined/redefined_builtin.txt diff --git a/tests/functional/r/redefined_builtin_allowed.py b/tests/functional/r/redefined/redefined_builtin_allowed.py similarity index 100% rename from tests/functional/r/redefined_builtin_allowed.py rename to tests/functional/r/redefined/redefined_builtin_allowed.py diff --git a/tests/functional/r/redefined_builtin_allowed.rc b/tests/functional/r/redefined/redefined_builtin_allowed.rc similarity index 100% rename from tests/functional/r/redefined_builtin_allowed.rc rename to tests/functional/r/redefined/redefined_builtin_allowed.rc diff --git a/tests/functional/r/redefined_builtin_allowed.txt b/tests/functional/r/redefined/redefined_builtin_allowed.txt similarity index 100% rename from tests/functional/r/redefined_builtin_allowed.txt rename to tests/functional/r/redefined/redefined_builtin_allowed.txt diff --git a/tests/functional/r/redefined_except_handler.py b/tests/functional/r/redefined/redefined_except_handler.py similarity index 100% rename from tests/functional/r/redefined_except_handler.py rename to tests/functional/r/redefined/redefined_except_handler.py diff --git a/tests/functional/r/redefined_except_handler.txt b/tests/functional/r/redefined/redefined_except_handler.txt similarity index 100% rename from tests/functional/r/redefined_except_handler.txt rename to tests/functional/r/redefined/redefined_except_handler.txt diff --git a/tests/functional/r/redefined_outer_name_type_checking.py b/tests/functional/r/redefined/redefined_outer_name_type_checking.py similarity index 100% rename from tests/functional/r/redefined_outer_name_type_checking.py rename to tests/functional/r/redefined/redefined_outer_name_type_checking.py diff --git a/tests/functional/r/redefined_outer_name_type_checking.rc b/tests/functional/r/redefined/redefined_outer_name_type_checking.rc similarity index 100% rename from tests/functional/r/redefined_outer_name_type_checking.rc rename to tests/functional/r/redefined/redefined_outer_name_type_checking.rc diff --git a/tests/functional/r/redefined_slots.py b/tests/functional/r/redefined/redefined_slots.py similarity index 100% rename from tests/functional/r/redefined_slots.py rename to tests/functional/r/redefined/redefined_slots.py diff --git a/tests/functional/r/redefined_slots.txt b/tests/functional/r/redefined/redefined_slots.txt similarity index 100% rename from tests/functional/r/redefined_slots.txt rename to tests/functional/r/redefined/redefined_slots.txt diff --git a/tests/functional/r/regression/regression_too_many_arguments_2335.py b/tests/functional/r/regression_02/regression_too_many_arguments_2335.py similarity index 100% rename from tests/functional/r/regression/regression_too_many_arguments_2335.py rename to tests/functional/r/regression_02/regression_too_many_arguments_2335.py diff --git a/tests/functional/s/simplifiable/simplify_chained_comparison.py b/tests/functional/s/simplify_chained_comparison.py similarity index 100% rename from tests/functional/s/simplifiable/simplify_chained_comparison.py rename to tests/functional/s/simplify_chained_comparison.py diff --git a/tests/functional/s/simplifiable/simplify_chained_comparison.txt b/tests/functional/s/simplify_chained_comparison.txt similarity index 100% rename from tests/functional/s/simplifiable/simplify_chained_comparison.txt rename to tests/functional/s/simplify_chained_comparison.txt diff --git a/tests/functional/s/super/superfluous_parens.py b/tests/functional/s/superfluous_parens.py similarity index 100% rename from tests/functional/s/super/superfluous_parens.py rename to tests/functional/s/superfluous_parens.py diff --git a/tests/functional/s/super/superfluous_parens.txt b/tests/functional/s/superfluous_parens.txt similarity index 100% rename from tests/functional/s/super/superfluous_parens.txt rename to tests/functional/s/superfluous_parens.txt diff --git a/tests/functional/s/super/superfluous_parens_walrus_py38.py b/tests/functional/s/superfluous_parens_walrus_py38.py similarity index 100% rename from tests/functional/s/super/superfluous_parens_walrus_py38.py rename to tests/functional/s/superfluous_parens_walrus_py38.py diff --git a/tests/functional/s/super/superfluous_parens_walrus_py38.rc b/tests/functional/s/superfluous_parens_walrus_py38.rc similarity index 100% rename from tests/functional/s/super/superfluous_parens_walrus_py38.rc rename to tests/functional/s/superfluous_parens_walrus_py38.rc diff --git a/tests/functional/s/super/superfluous_parens_walrus_py38.txt b/tests/functional/s/superfluous_parens_walrus_py38.txt similarity index 100% rename from tests/functional/s/super/superfluous_parens_walrus_py38.txt rename to tests/functional/s/superfluous_parens_walrus_py38.txt diff --git a/tests/functional/s/symlink/_binding/__init__.py b/tests/functional/s/symlink/_binding/__init__.py new file mode 120000 index 0000000000..dda2f5dc5f --- /dev/null +++ b/tests/functional/s/symlink/_binding/__init__.py @@ -0,0 +1 @@ +../symlink_module/__init__.py \ No newline at end of file diff --git a/tests/functional/s/symlink/_binding/symlink_module.py b/tests/functional/s/symlink/_binding/symlink_module.py new file mode 120000 index 0000000000..af65afbc35 --- /dev/null +++ b/tests/functional/s/symlink/_binding/symlink_module.py @@ -0,0 +1 @@ +../symlink_module/symlink_module.py \ No newline at end of file diff --git a/tests/functional/s/symlink/binding/__init__.py b/tests/functional/s/symlink/binding/__init__.py deleted file mode 120000 index 70a3e97c5e..0000000000 --- a/tests/functional/s/symlink/binding/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../module/__init__.py \ No newline at end of file diff --git a/tests/functional/s/symlink/binding/symlinked_module.py b/tests/functional/s/symlink/binding/symlinked_module.py deleted file mode 120000 index 09382e43ee..0000000000 --- a/tests/functional/s/symlink/binding/symlinked_module.py +++ /dev/null @@ -1 +0,0 @@ -../module/symlinked_module.py \ No newline at end of file diff --git a/tests/functional/s/symlink/module/__init__.py b/tests/functional/s/symlink/symlink_module/__init__.py similarity index 100% rename from tests/functional/s/symlink/module/__init__.py rename to tests/functional/s/symlink/symlink_module/__init__.py diff --git a/tests/functional/s/symlink/module/symlinked_module.py b/tests/functional/s/symlink/symlink_module/symlink_module.py similarity index 100% rename from tests/functional/s/symlink/module/symlinked_module.py rename to tests/functional/s/symlink/symlink_module/symlink_module.py diff --git a/tests/functional/s/syntax_error.py b/tests/functional/s/syntax/syntax_error.py similarity index 100% rename from tests/functional/s/syntax_error.py rename to tests/functional/s/syntax/syntax_error.py diff --git a/tests/functional/s/syntax_error.rc b/tests/functional/s/syntax/syntax_error.rc similarity index 100% rename from tests/functional/s/syntax_error.rc rename to tests/functional/s/syntax/syntax_error.rc diff --git a/tests/functional/s/syntax_error.txt b/tests/functional/s/syntax/syntax_error.txt similarity index 100% rename from tests/functional/s/syntax_error.txt rename to tests/functional/s/syntax/syntax_error.txt diff --git a/tests/functional/s/syntax_error_jython.py b/tests/functional/s/syntax/syntax_error_jython.py similarity index 100% rename from tests/functional/s/syntax_error_jython.py rename to tests/functional/s/syntax/syntax_error_jython.py diff --git a/tests/functional/s/syntax_error_jython.rc b/tests/functional/s/syntax/syntax_error_jython.rc similarity index 100% rename from tests/functional/s/syntax_error_jython.rc rename to tests/functional/s/syntax/syntax_error_jython.rc diff --git a/tests/functional/s/syntax_error_jython.txt b/tests/functional/s/syntax/syntax_error_jython.txt similarity index 100% rename from tests/functional/s/syntax_error_jython.txt rename to tests/functional/s/syntax/syntax_error_jython.txt diff --git a/tests/functional/u/unbalanced_tuple_unpacking.py b/tests/functional/u/unbalanced_tuple_unpacking.py index 20e3c29288..d3816f9a9b 100644 --- a/tests/functional/u/unbalanced_tuple_unpacking.py +++ b/tests/functional/u/unbalanced_tuple_unpacking.py @@ -1,7 +1,7 @@ """Check possible unbalanced tuple unpacking """ from __future__ import absolute_import from typing import NamedTuple -from functional.u.unpacking import unpack +from functional.u.unpacking.unpacking import unpack # pylint: disable=missing-class-docstring, missing-function-docstring, using-constant-test, useless-object-inheritance,import-outside-toplevel diff --git a/tests/functional/u/unbalanced_tuple_unpacking.txt b/tests/functional/u/unbalanced_tuple_unpacking.txt index d2df38cfd7..6298dd5315 100644 --- a/tests/functional/u/unbalanced_tuple_unpacking.txt +++ b/tests/functional/u/unbalanced_tuple_unpacking.txt @@ -1,8 +1,8 @@ unbalanced-tuple-unpacking:11:4:11:27:do_stuff:"Possible unbalanced tuple unpacking with sequence (1, 2, 3): left side has 2 label(s), right side has 3 value(s)":UNDEFINED unbalanced-tuple-unpacking:17:4:17:29:do_stuff1:"Possible unbalanced tuple unpacking with sequence [1, 2, 3]: left side has 2 label(s), right side has 3 value(s)":UNDEFINED unbalanced-tuple-unpacking:23:4:23:29:do_stuff2:"Possible unbalanced tuple unpacking with sequence (1, 2, 3): left side has 2 label(s), right side has 3 value(s)":UNDEFINED -unbalanced-tuple-unpacking:82:4:82:28:do_stuff9:"Possible unbalanced tuple unpacking with sequence defined at line 7 of functional.u.unpacking: left side has 2 label(s), right side has 3 value(s)":UNDEFINED -unbalanced-tuple-unpacking:96:8:96:33:UnbalancedUnpacking.test:"Possible unbalanced tuple unpacking with sequence defined at line 7 of functional.u.unpacking: left side has 2 label(s), right side has 3 value(s)":UNDEFINED +unbalanced-tuple-unpacking:82:4:82:28:do_stuff9:"Possible unbalanced tuple unpacking with sequence defined at line 7 of functional.u.unpacking.unpacking: left side has 2 label(s), right side has 3 value(s)":UNDEFINED +unbalanced-tuple-unpacking:96:8:96:33:UnbalancedUnpacking.test:"Possible unbalanced tuple unpacking with sequence defined at line 7 of functional.u.unpacking.unpacking: left side has 2 label(s), right side has 3 value(s)":UNDEFINED unbalanced-tuple-unpacking:140:8:140:43:MyClass.sum_unpack_3_into_4:"Possible unbalanced tuple unpacking with sequence defined at line 128: left side has 4 label(s), right side has 3 value(s)":UNDEFINED unbalanced-tuple-unpacking:145:8:145:28:MyClass.sum_unpack_3_into_2:"Possible unbalanced tuple unpacking with sequence defined at line 128: left side has 2 label(s), right side has 3 value(s)":UNDEFINED unbalanced-tuple-unpacking:157:0:157:24::"Possible unbalanced tuple unpacking with sequence defined at line 151: left side has 2 label(s), right side has 0 value(s)":UNDEFINED diff --git a/tests/functional/u/unpacking.py b/tests/functional/u/unpacking/unpacking.py similarity index 100% rename from tests/functional/u/unpacking.py rename to tests/functional/u/unpacking/unpacking.py diff --git a/tests/functional/u/unpacking_generalizations.py b/tests/functional/u/unpacking/unpacking_generalizations.py similarity index 100% rename from tests/functional/u/unpacking_generalizations.py rename to tests/functional/u/unpacking/unpacking_generalizations.py diff --git a/tests/functional/u/unpacking_generalizations.txt b/tests/functional/u/unpacking/unpacking_generalizations.txt similarity index 100% rename from tests/functional/u/unpacking_generalizations.txt rename to tests/functional/u/unpacking/unpacking_generalizations.txt diff --git a/tests/functional/u/unpacking_non_sequence.py b/tests/functional/u/unpacking/unpacking_non_sequence.py similarity index 98% rename from tests/functional/u/unpacking_non_sequence.py rename to tests/functional/u/unpacking/unpacking_non_sequence.py index e9c23b388d..0299af762d 100644 --- a/tests/functional/u/unpacking_non_sequence.py +++ b/tests/functional/u/unpacking/unpacking_non_sequence.py @@ -3,7 +3,7 @@ # pylint: disable=too-few-public-methods, invalid-name, attribute-defined-outside-init, unused-variable # pylint: disable=using-constant-test, no-init, missing-docstring, wrong-import-order,wrong-import-position,no-else-return, useless-object-inheritance from os import rename as nonseq_func -from functional.u.unpacking import nonseq +from functional.u.unpacking.unpacking import nonseq from typing import NamedTuple __revision__ = 0 diff --git a/tests/functional/u/unpacking_non_sequence.txt b/tests/functional/u/unpacking/unpacking_non_sequence.txt similarity index 86% rename from tests/functional/u/unpacking_non_sequence.txt rename to tests/functional/u/unpacking/unpacking_non_sequence.txt index d657af1776..c3c65050cb 100644 --- a/tests/functional/u/unpacking_non_sequence.txt +++ b/tests/functional/u/unpacking/unpacking_non_sequence.txt @@ -2,8 +2,8 @@ unpacking-non-sequence:78:0:78:15::Attempting to unpack a non-sequence defined a unpacking-non-sequence:79:0:79:17::Attempting to unpack a non-sequence:UNDEFINED unpacking-non-sequence:80:0:80:11::Attempting to unpack a non-sequence None:UNDEFINED unpacking-non-sequence:81:0:81:8::Attempting to unpack a non-sequence 1:UNDEFINED -unpacking-non-sequence:82:0:82:13::Attempting to unpack a non-sequence defined at line 9 of functional.u.unpacking:UNDEFINED -unpacking-non-sequence:83:0:83:15::Attempting to unpack a non-sequence defined at line 11 of functional.u.unpacking:UNDEFINED +unpacking-non-sequence:82:0:82:13::Attempting to unpack a non-sequence defined at line 9 of functional.u.unpacking.unpacking:UNDEFINED +unpacking-non-sequence:83:0:83:15::Attempting to unpack a non-sequence defined at line 11 of functional.u.unpacking.unpacking:UNDEFINED unpacking-non-sequence:84:0:84:18::Attempting to unpack a non-sequence:UNDEFINED unpacking-non-sequence:99:8:99:33:ClassUnpacking.test:Attempting to unpack a non-sequence defined at line 75:UNDEFINED unpacking-non-sequence:100:8:100:35:ClassUnpacking.test:Attempting to unpack a non-sequence:UNDEFINED diff --git a/tests/functional/u/unpacking_non_sequence_py37.py b/tests/functional/u/unpacking/unpacking_non_sequence_py37.py similarity index 100% rename from tests/functional/u/unpacking_non_sequence_py37.py rename to tests/functional/u/unpacking/unpacking_non_sequence_py37.py diff --git a/tests/functional/u/unpacking_non_sequence_py37.rc b/tests/functional/u/unpacking/unpacking_non_sequence_py37.rc similarity index 100% rename from tests/functional/u/unpacking_non_sequence_py37.rc rename to tests/functional/u/unpacking/unpacking_non_sequence_py37.rc diff --git a/tests/functional/u/use/used_before_assignment.py b/tests/functional/u/used/used_before_assignment.py similarity index 100% rename from tests/functional/u/use/used_before_assignment.py rename to tests/functional/u/used/used_before_assignment.py diff --git a/tests/functional/u/use/used_before_assignment.txt b/tests/functional/u/used/used_before_assignment.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment.txt rename to tests/functional/u/used/used_before_assignment.txt diff --git a/tests/functional/u/use/used_before_assignment_488.py b/tests/functional/u/used/used_before_assignment_488.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_488.py rename to tests/functional/u/used/used_before_assignment_488.py diff --git a/tests/functional/u/use/used_before_assignment_except_handler_for_try_with_return.py b/tests/functional/u/used/used_before_assignment_except_handler_for_try_with_return.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_except_handler_for_try_with_return.py rename to tests/functional/u/used/used_before_assignment_except_handler_for_try_with_return.py diff --git a/tests/functional/u/use/used_before_assignment_except_handler_for_try_with_return.txt b/tests/functional/u/used/used_before_assignment_except_handler_for_try_with_return.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_except_handler_for_try_with_return.txt rename to tests/functional/u/used/used_before_assignment_except_handler_for_try_with_return.txt diff --git a/tests/functional/u/use/used_before_assignment_filtered_comprehension.py b/tests/functional/u/used/used_before_assignment_filtered_comprehension.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_filtered_comprehension.py rename to tests/functional/u/used/used_before_assignment_filtered_comprehension.py diff --git a/tests/functional/u/use/used_before_assignment_issue1081.py b/tests/functional/u/used/used_before_assignment_issue1081.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue1081.py rename to tests/functional/u/used/used_before_assignment_issue1081.py diff --git a/tests/functional/u/use/used_before_assignment_issue1081.txt b/tests/functional/u/used/used_before_assignment_issue1081.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue1081.txt rename to tests/functional/u/used/used_before_assignment_issue1081.txt diff --git a/tests/functional/u/use/used_before_assignment_issue2615.py b/tests/functional/u/used/used_before_assignment_issue2615.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue2615.py rename to tests/functional/u/used/used_before_assignment_issue2615.py diff --git a/tests/functional/u/use/used_before_assignment_issue2615.txt b/tests/functional/u/used/used_before_assignment_issue2615.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue2615.txt rename to tests/functional/u/used/used_before_assignment_issue2615.txt diff --git a/tests/functional/u/use/used_before_assignment_issue4761.py b/tests/functional/u/used/used_before_assignment_issue4761.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue4761.py rename to tests/functional/u/used/used_before_assignment_issue4761.py diff --git a/tests/functional/u/use/used_before_assignment_issue4761.txt b/tests/functional/u/used/used_before_assignment_issue4761.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue4761.txt rename to tests/functional/u/used/used_before_assignment_issue4761.txt diff --git a/tests/functional/u/use/used_before_assignment_issue626.py b/tests/functional/u/used/used_before_assignment_issue626.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue626.py rename to tests/functional/u/used/used_before_assignment_issue626.py diff --git a/tests/functional/u/use/used_before_assignment_issue626.txt b/tests/functional/u/used/used_before_assignment_issue626.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue626.txt rename to tests/functional/u/used/used_before_assignment_issue626.txt diff --git a/tests/functional/u/use/used_before_assignment_issue85.py b/tests/functional/u/used/used_before_assignment_issue85.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue85.py rename to tests/functional/u/used/used_before_assignment_issue85.py diff --git a/tests/functional/u/use/used_before_assignment_issue85.txt b/tests/functional/u/used/used_before_assignment_issue85.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue85.txt rename to tests/functional/u/used/used_before_assignment_issue85.txt diff --git a/tests/functional/u/use/used_before_assignment_issue853.py b/tests/functional/u/used/used_before_assignment_issue853.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_issue853.py rename to tests/functional/u/used/used_before_assignment_issue853.py diff --git a/tests/functional/u/use/used_before_assignment_nonlocal.py b/tests/functional/u/used/used_before_assignment_nonlocal.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_nonlocal.py rename to tests/functional/u/used/used_before_assignment_nonlocal.py diff --git a/tests/functional/u/use/used_before_assignment_nonlocal.txt b/tests/functional/u/used/used_before_assignment_nonlocal.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_nonlocal.txt rename to tests/functional/u/used/used_before_assignment_nonlocal.txt diff --git a/tests/functional/u/use/used_before_assignment_py37.py b/tests/functional/u/used/used_before_assignment_py37.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_py37.py rename to tests/functional/u/used/used_before_assignment_py37.py diff --git a/tests/functional/u/use/used_before_assignment_py37.rc b/tests/functional/u/used/used_before_assignment_py37.rc similarity index 100% rename from tests/functional/u/use/used_before_assignment_py37.rc rename to tests/functional/u/used/used_before_assignment_py37.rc diff --git a/tests/functional/u/use/used_before_assignment_py37.txt b/tests/functional/u/used/used_before_assignment_py37.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_py37.txt rename to tests/functional/u/used/used_before_assignment_py37.txt diff --git a/tests/functional/u/use/used_before_assignment_type_annotations.py b/tests/functional/u/used/used_before_assignment_type_annotations.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_type_annotations.py rename to tests/functional/u/used/used_before_assignment_type_annotations.py diff --git a/tests/functional/u/use/used_before_assignment_type_annotations.txt b/tests/functional/u/used/used_before_assignment_type_annotations.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_type_annotations.txt rename to tests/functional/u/used/used_before_assignment_type_annotations.txt diff --git a/tests/functional/u/use/used_before_assignment_typing.py b/tests/functional/u/used/used_before_assignment_typing.py similarity index 100% rename from tests/functional/u/use/used_before_assignment_typing.py rename to tests/functional/u/used/used_before_assignment_typing.py diff --git a/tests/functional/u/use/used_before_assignment_typing.txt b/tests/functional/u/used/used_before_assignment_typing.txt similarity index 100% rename from tests/functional/u/use/used_before_assignment_typing.txt rename to tests/functional/u/used/used_before_assignment_typing.txt diff --git a/tests/functional/u/use/used_prior_global_declaration.py b/tests/functional/u/used/used_prior_global_declaration.py similarity index 100% rename from tests/functional/u/use/used_prior_global_declaration.py rename to tests/functional/u/used/used_prior_global_declaration.py diff --git a/tests/functional/u/use/used_prior_global_declaration.txt b/tests/functional/u/used/used_prior_global_declaration.txt similarity index 100% rename from tests/functional/u/use/used_prior_global_declaration.txt rename to tests/functional/u/used/used_prior_global_declaration.txt diff --git a/tests/functional/u/use/using_constant_test.py b/tests/functional/u/using_constant_test.py similarity index 100% rename from tests/functional/u/use/using_constant_test.py rename to tests/functional/u/using_constant_test.py diff --git a/tests/functional/u/use/using_constant_test.txt b/tests/functional/u/using_constant_test.txt similarity index 100% rename from tests/functional/u/use/using_constant_test.txt rename to tests/functional/u/using_constant_test.txt diff --git a/tests/test_functional_directories.py b/tests/test_functional_directories.py new file mode 100644 index 0000000000..a01f19cdd1 --- /dev/null +++ b/tests/test_functional_directories.py @@ -0,0 +1,12 @@ +"""Test that the directory structure of the functional tests is correct.""" +from pathlib import Path + +from pylint.testutils.functional.find_functional_tests import ( + get_functional_test_files_from_directory, +) + + +def test_directories() -> None: + """Test that the directory structure of the functional tests is correct.""" + functional_dir = Path(__file__).parent / "functional" + get_functional_test_files_from_directory(functional_dir) diff --git a/tests/testutils/data/u/use/use_len.py b/tests/testutils/data/u/use/use_len.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/testutils/data/u/use/using_dir.py b/tests/testutils/data/u/use/using_dir.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/testutils/data/u/use_dir.py b/tests/testutils/data/u/use_dir.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/testutils/data/u/using/using_len.py b/tests/testutils/data/u/using/using_len.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/testutils/test_functional_testutils.py b/tests/testutils/test_functional_testutils.py index c1e852e15b..032f6ac120 100644 --- a/tests/testutils/test_functional_testutils.py +++ b/tests/testutils/test_functional_testutils.py @@ -8,7 +8,10 @@ import pytest from pylint import testutils -from pylint.testutils.functional import FunctionalTestFile +from pylint.testutils.functional import ( + FunctionalTestFile, + get_functional_test_files_from_directory, +) HERE = Path(__file__).parent DATA_DIRECTORY = HERE / "data" @@ -19,3 +22,9 @@ def test_parsing_of_pylintrc_init_hook() -> None: with pytest.raises(RuntimeError): test_file = FunctionalTestFile(str(DATA_DIRECTORY), "init_hook.py") testutils.LintModuleTest(test_file) + + +def test_get_functional_test_files_from_directory() -> None: + """Test that we correctly check the functional test directory structures.""" + with pytest.raises(AssertionError, match="using_dir.py should not go in"): + get_functional_test_files_from_directory(DATA_DIRECTORY)