From b41931650faadc0b388223da6508a244e5b76900 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 5 Dec 2021 13:39:56 +0100 Subject: [PATCH 1/3] [functional test] Re-organize functionnal tests directories By using the message name as directory name when applicable. --- .../anomalous_backslash_escape.py | 0 .../anomalous_backslash_escape.txt | 0 .../anomalous_unicode_escape.py | 0 .../anomalous_unicode_escape.txt | 0 .../arguments_out_of_order.py | 0 .../arguments_out_of_order.txt | 0 tests/functional/a/arguments.py | 9 +--- tests/functional/a/arguments.txt | 21 ++++---- .../assignment_from_no_return.py | 0 .../assignment_from_no_return.txt | 0 .../assignment_from_no_return_2.py | 0 .../assignment_from_no_return_2.txt | 0 .../assignment_from_no_return_py3.py | 0 .../await_outside_async.py | 0 .../await_outside_async.rc | 0 .../await_outside_async.txt | 0 .../bad_except_order.py | 0 .../bad_except_order.txt | 0 .../bad_exception_context.py | 0 .../bad_exception_context.txt | 0 .../bad_inline_option.py | 0 .../bad_inline_option.rc | 0 .../bad_inline_option.txt | 0 .../b/{ => bad-open-mode}/bad_open_mode.py | 0 .../b/{ => bad-open-mode}/bad_open_mode.rc | 0 .../b/{ => bad-open-mode}/bad_open_mode.txt | 0 .../bad_option_value.py | 0 .../bad_option_value.txt | 0 .../bad-plugin-value/.gitkeep} | 0 .../bad_thread_instantiation.py | 0 .../bad_thread_instantiation.txt | 0 .../deprecated_class_py33.py | 0 .../deprecated_class_py33.rc | 0 .../deprecated_class_py33.txt | 0 .../deprecated_decorators.py | 0 .../deprecated_decorators.txt | 0 .../deprecated_method_getmoduleinfo.py | 0 .../deprecated_method_getmoduleinfo.rc | 0 .../deprecated_method_getmoduleinfo.txt | 0 .../deprecated_methods_py3.py | 0 .../deprecated_methods_py3.rc | 0 .../deprecated_methods_py3.txt | 0 .../deprecated_methods_py36.py | 0 .../deprecated_methods_py36.txt | 0 .../deprecated_methods_py38.py | 0 .../deprecated_methods_py38.rc | 0 .../deprecated_methods_py38.txt | 0 .../deprecated-pragma/deprecated_pragma.py} | 0 .../deprecated-pragma/deprecated_pragma.txt} | 0 .../dict_iter_missing_items.py | 0 .../dict_iter_missing_items.txt | 0 .../f_string_without_interpolation.py | 0 .../f_string_without_interpolation.txt | 0 .../forgotten_debug_statement_py37.py | 0 .../forgotten_debug_statement_py37.rc | 0 .../forgotten_debug_statement_py37.txt | 0 .../implicit_str_concat.py | 0 .../implicit_str_concat.txt | 0 .../implicit_str_concat_latin1.py | 0 .../implicit_str_concat_multiline.py | 0 .../implicit_str_concat_multiline.rc | 0 .../implicit_str_concat_multiline.txt | 0 .../implicit_str_concat_utf8.py | 0 tests/functional/i/import_error.py | 2 +- tests/functional/i/import_error.txt | 4 +- .../inconsistent_quotes.py | 0 .../inconsistent_quotes.rc | 0 .../inconsistent_quotes.txt | 0 .../inconsistent_quotes2.py | 0 .../inconsistent_quotes2.rc | 0 .../inconsistent_quotes2.txt | 0 .../invalid_envvar_default.py | 54 +++++++++++++++++++ .../invalid_envvar_default.txt | 12 +++++ .../invalid_envvar_value.py | 18 ------- .../invalid_envvar_value.txt | 8 --- .../invalid_metaclass.py | 0 .../invalid_metaclass.txt | 0 .../invalid_metaclass_py3.py | 0 .../invalid_sequence_index.py | 0 .../invalid_sequence_index.txt | 0 .../invalid_slice_index.py | 0 .../invalid_slice_index.txt | 0 .../invalid_unary_operand_type.py | 0 .../invalid_unary_operand_type.txt | 0 .../isinstance_second_argument.py | 0 .../isinstance_second_argument.txt | 0 tests/functional/i/iterable_context.py | 10 ++-- .../keyword_arg_before_vararg.py | 0 .../keyword_arg_before_vararg.txt | 0 .../logging_format_interpolation.py | 0 .../logging_format_interpolation.txt | 0 .../logging_format_interpolation_py36.py | 0 .../logging_format_interpolation_py36.txt | 0 .../logging_format_interpolation_style.py | 0 .../logging_format_interpolation_style.rc | 0 .../logging_fstring_interpolation_py36.py | 0 .../logging_fstring_interpolation_py36.txt | 0 .../logging_fstring_interpolation_py37.py | 0 .../logging_fstring_interpolation_py37.rc | 0 .../logging_fstring_interpolation_py37.txt | 0 .../logging_not_lazy.py | 0 .../logging_not_lazy.txt | 0 .../logging_not_lazy_module.py | 0 .../logging_not_lazy_module.rc | 0 .../logging_not_lazy_module.txt | 0 .../logging_not_lazy_with_logger.py | 0 .../logging_not_lazy_with_logger.txt | 0 .../logging_too_few_args.py | 0 .../logging_too_few_args.rc | 0 .../logging_too_few_args.txt | 0 .../logging_too_many_args.py | 0 .../logging_too_many_args.rc | 0 .../logging_too_many_args.txt | 0 .../misplaced_bare_raise.py | 0 .../misplaced_bare_raise.txt | 0 .../{missing => missing-kwoa}/missing_kwoa.py | 0 .../missing_kwoa.txt | 0 .../n/{no => no-member}/no_member.py | 0 .../no_member_dataclasses.py | 0 .../no_member_dataclasses.rc | 0 .../no_member_dataclasses.txt | 0 .../no_member_if_statements.py | 0 .../no_member_if_statements.txt | 0 .../n/{no => no-member}/no_member_imports.py | 0 .../n/{no => no-member}/no_member_imports.rc | 0 .../n/{no => no-member}/no_member_imports.txt | 0 .../no_member_nested_namedtuple.py | 0 .../no_member_nested_namedtuple.rc | 0 .../no_member_subclassed_dataclasses.py | 0 .../no_member_subclassed_dataclasses.rc | 0 .../non_str_assignment_to_dunder_name.py | 0 .../non_str_assignment_to_dunder_name.txt | 0 .../{m => n/not-a-mapping}/mapping_context.py | 0 .../not-a-mapping}/mapping_context.txt | 0 .../not-a-mapping}/mapping_context_py3.py | 0 .../not-a-mapping}/mapping_context_py3.txt | 0 .../not_async_context_manager.py | 0 .../not_async_context_manager.txt | 0 .../not_async_context_manager_py37.py | 0 .../not_async_context_manager_py37.rc | 0 .../n/{ => not-callable}/not_callable.py | 0 .../n/{ => not-callable}/not_callable.txt | 0 .../not_context_manager.py | 0 .../not_context_manager.txt | 0 .../raising_bad_type.py | 0 .../raising_bad_type.txt | 0 .../raising_non_exception.py | 0 .../raising_non_exception.txt | 0 .../redundant_keyword_arg.py | 19 +++++++ .../redundant_keyword_arg.txt | 1 + .../redundant_u_string_prefix.py | 0 .../redundant_u_string_prefix.rc | 0 .../redundant_u_string_prefix.txt | 0 .../redundant_unittest_assert.py | 0 .../redundant_unittest_assert.txt | 0 .../repeated_keyword.py | 0 .../repeated_keyword.txt | 0 tests/functional/s/__init__.py | 0 .../shallow_copy_environ.py | 0 .../shallow_copy_environ.txt | 0 .../subprocess_popen_preexec_fn.py | 0 .../subprocess_popen_preexec_fn.txt | 0 .../subprocess_run_check.py | 0 .../subprocess_run_check.txt | 0 .../s/{ => syntax_error}/syntax_error.py | 0 .../s/{ => syntax_error}/syntax_error.rc | 0 .../s/{ => syntax_error}/syntax_error.txt | 0 .../{ => syntax_error}/syntax_error_jython.py | 0 .../{ => syntax_error}/syntax_error_jython.rc | 0 .../syntax_error_jython.txt | 0 .../too_few_public_methods.py | 0 .../too_few_public_methods.txt | 0 .../too_few_public_methods_37.py | 0 .../too_few_public_methods_37.rc | 0 .../too_few_public_methods_excluded.py | 0 .../too_few_public_methods_excluded.rc | 0 .../too_few_public_methods_excluded.txt | 0 .../t/too-many-ancestors/__init__.py | 1 + .../too_many_ancestors.py | 0 .../too_many_ancestors.txt | 0 .../too_many_ancestors_ignored_parents.py | 0 .../too_many_ancestors_ignored_parents.rc | 3 ++ .../too_many_ancestors_ignored_parents.txt | 0 .../too_many_arguments.py | 0 .../too_many_arguments.txt | 0 .../too_many_arguments_issue_1045.py | 0 .../too_many_arguments_overload.py | 0 .../too_many_boolean_expressions.py | 0 .../too_many_boolean_expressions.txt | 0 .../too_many_branches.py | 0 .../too_many_branches.txt | 0 .../too_many_instance_attributes.py | 0 .../too_many_instance_attributes.txt | 0 .../too_many_instance_attributes_py37.py | 0 .../too_many_instance_attributes_py37.rc | 0 .../{too => too-many-lines}/too_many_lines.py | 0 .../too_many_lines.txt | 0 .../too_many_lines_disabled.py | 0 .../too_many_locals.py | 0 .../too_many_locals.txt | 0 .../too_many_nested_blocks.py | 0 .../too_many_nested_blocks.txt | 0 .../too_many_public_methods.py | 0 .../too_many_public_methods.txt | 0 .../too_many_return_statements.py | 0 .../too_many_return_statements.txt | 0 .../too_many_star_expressions.py | 0 .../too_many_star_expressions.txt | 0 .../too_many_statements.py | 0 .../too_many_statements.rc | 0 .../too_many_statements.txt | 0 tests/functional/t/too/__init__.py | 0 .../too/too_many_ancestors_ignored_parents.rc | 3 -- .../unhashable_dict_key.py | 0 .../unhashable_dict_key.txt | 0 .../unrecognized_inline_option.py | 0 .../unrecognized_inline_option.txt | 0 .../unspecified_encoding_py38.py | 0 .../unspecified_encoding_py38.rc | 0 .../unspecified_encoding_py38.txt | 0 .../unsubscriptable_object.py | 0 .../unsupported_assignment_operation.py | 0 .../unsupported_assignment_operation.rc | 0 .../unsupported_assignment_operation.txt | 0 .../unsupported_binary_operation.py | 0 .../unsupported_binary_operation.rc | 0 .../unsupported_binary_operation.txt | 0 .../unsupported_delete_operation.py | 0 .../unsupported_delete_operation.rc | 0 .../unsupported_delete_operation.txt | 0 .../membership_protocol.py | 0 .../membership_protocol.txt | 0 .../membership_protocol_py3.py | 0 .../membership_protocol_py3.txt | 0 .../useless_suppression.py | 0 .../yield_inside_async_function.py | 0 .../yield_inside_async_function.txt | 0 237 files changed, 109 insertions(+), 56 deletions(-) rename tests/functional/a/{ => anomalous-backslash-in-string}/anomalous_backslash_escape.py (100%) rename tests/functional/a/{ => anomalous-backslash-in-string}/anomalous_backslash_escape.txt (100%) rename tests/functional/a/{ => anomalous-unicode-escape-in-string}/anomalous_unicode_escape.py (100%) rename tests/functional/a/{ => anomalous-unicode-escape-in-string}/anomalous_unicode_escape.txt (100%) rename tests/functional/a/{ => arguments-out-of-order}/arguments_out_of_order.py (100%) rename tests/functional/a/{ => arguments-out-of-order}/arguments_out_of_order.txt (100%) rename tests/functional/a/{assign => assignment-from-no-return}/assignment_from_no_return.py (100%) rename tests/functional/a/{assign => assignment-from-no-return}/assignment_from_no_return.txt (100%) rename tests/functional/a/{assign => assignment-from-no-return}/assignment_from_no_return_2.py (100%) rename tests/functional/a/{assign => assignment-from-no-return}/assignment_from_no_return_2.txt (100%) rename tests/functional/a/{assign => assignment-from-no-return}/assignment_from_no_return_py3.py (100%) rename tests/functional/a/{ => await-outside-async}/await_outside_async.py (100%) rename tests/functional/a/{ => await-outside-async}/await_outside_async.rc (100%) rename tests/functional/a/{ => await-outside-async}/await_outside_async.txt (100%) rename tests/functional/b/{ => bad-except-order}/bad_except_order.py (100%) rename tests/functional/b/{ => bad-except-order}/bad_except_order.txt (100%) rename tests/functional/b/{ => bad-exception-context}/bad_exception_context.py (100%) rename tests/functional/b/{ => bad-exception-context}/bad_exception_context.txt (100%) rename tests/functional/b/{ => bad-inline-option}/bad_inline_option.py (100%) rename tests/functional/b/{ => bad-inline-option}/bad_inline_option.rc (100%) rename tests/functional/b/{ => bad-inline-option}/bad_inline_option.txt (100%) rename tests/functional/b/{ => bad-open-mode}/bad_open_mode.py (100%) rename tests/functional/b/{ => bad-open-mode}/bad_open_mode.rc (100%) rename tests/functional/b/{ => bad-open-mode}/bad_open_mode.txt (100%) rename tests/functional/b/{ => bad-option-value}/bad_option_value.py (100%) rename tests/functional/b/{ => bad-option-value}/bad_option_value.txt (100%) rename tests/functional/{k/__init__.py => b/bad-plugin-value/.gitkeep} (100%) rename tests/functional/b/{ => bad-thread-instantiation}/bad_thread_instantiation.py (100%) rename tests/functional/b/{ => bad-thread-instantiation}/bad_thread_instantiation.txt (100%) rename tests/functional/d/{deprecated => deprecated-class}/deprecated_class_py33.py (100%) rename tests/functional/d/{deprecated => deprecated-class}/deprecated_class_py33.rc (100%) rename tests/functional/d/{deprecated => deprecated-class}/deprecated_class_py33.txt (100%) rename tests/functional/d/{deprecated => deprecated-decorator}/deprecated_decorators.py (100%) rename tests/functional/d/{deprecated => deprecated-decorator}/deprecated_decorators.txt (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_method_getmoduleinfo.py (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_method_getmoduleinfo.rc (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_method_getmoduleinfo.txt (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py3.py (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py3.rc (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py3.txt (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py36.py (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py36.txt (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py38.py (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py38.rc (100%) rename tests/functional/d/{deprecated => deprecated-method}/deprecated_methods_py38.txt (100%) rename tests/functional/{r/regression/regression_infer_call_result_3690.py => d/deprecated-pragma/deprecated_pragma.py} (100%) rename tests/functional/{r/regression/regression_infer_call_result_3690.txt => d/deprecated-pragma/deprecated_pragma.txt} (100%) rename tests/functional/d/{ => dict-iter-missing-items}/dict_iter_missing_items.py (100%) rename tests/functional/d/{ => dict-iter-missing-items}/dict_iter_missing_items.txt (100%) rename tests/functional/f/{ => f-string-without-interpolation}/f_string_without_interpolation.py (100%) rename tests/functional/f/{ => f-string-without-interpolation}/f_string_without_interpolation.txt (100%) rename tests/functional/f/{ => forgotten-debug-statement}/forgotten_debug_statement_py37.py (100%) rename tests/functional/f/{ => forgotten-debug-statement}/forgotten_debug_statement_py37.rc (100%) rename tests/functional/f/{ => forgotten-debug-statement}/forgotten_debug_statement_py37.txt (100%) rename tests/functional/i/{implicit => implicit-str-concat}/implicit_str_concat.py (100%) rename tests/functional/i/{implicit => implicit-str-concat}/implicit_str_concat.txt (100%) rename tests/functional/i/{implicit => implicit-str-concat}/implicit_str_concat_latin1.py (100%) rename tests/functional/i/{implicit => implicit-str-concat}/implicit_str_concat_multiline.py (100%) rename tests/functional/i/{implicit => implicit-str-concat}/implicit_str_concat_multiline.rc (100%) rename tests/functional/i/{implicit => implicit-str-concat}/implicit_str_concat_multiline.txt (100%) rename tests/functional/i/{implicit => implicit-str-concat}/implicit_str_concat_utf8.py (100%) rename tests/functional/i/{inconsistent => inconsistent-quotes}/inconsistent_quotes.py (100%) rename tests/functional/i/{inconsistent => inconsistent-quotes}/inconsistent_quotes.rc (100%) rename tests/functional/i/{inconsistent => inconsistent-quotes}/inconsistent_quotes.txt (100%) rename tests/functional/i/{inconsistent => inconsistent-quotes}/inconsistent_quotes2.py (100%) rename tests/functional/i/{inconsistent => inconsistent-quotes}/inconsistent_quotes2.rc (100%) rename tests/functional/i/{inconsistent => inconsistent-quotes}/inconsistent_quotes2.txt (100%) create mode 100644 tests/functional/i/invalid-envvar-default/invalid_envvar_default.py create mode 100644 tests/functional/i/invalid-envvar-default/invalid_envvar_default.txt rename tests/functional/i/{invalid/e => invalid-envvar-value}/invalid_envvar_value.py (72%) rename tests/functional/i/{invalid/e => invalid-envvar-value}/invalid_envvar_value.txt (72%) rename tests/functional/i/{invalid/m => invalid-metaclass}/invalid_metaclass.py (100%) rename tests/functional/i/{invalid/m => invalid-metaclass}/invalid_metaclass.txt (100%) rename tests/functional/i/{invalid/m => invalid-metaclass}/invalid_metaclass_py3.py (100%) rename tests/functional/i/{invalid/s => invalid-sequence-index}/invalid_sequence_index.py (100%) rename tests/functional/i/{invalid/s => invalid-sequence-index}/invalid_sequence_index.txt (100%) rename tests/functional/i/{invalid/s => invalid-slice-index}/invalid_slice_index.py (100%) rename tests/functional/i/{invalid/s => invalid-slice-index}/invalid_slice_index.txt (100%) rename tests/functional/i/{invalid => invalid-unary-operand-type}/invalid_unary_operand_type.py (100%) rename tests/functional/i/{invalid => invalid-unary-operand-type}/invalid_unary_operand_type.txt (100%) rename tests/functional/i/{ => isinstance-second-argument-not-valid-type}/isinstance_second_argument.py (100%) rename tests/functional/i/{ => isinstance-second-argument-not-valid-type}/isinstance_second_argument.txt (100%) rename tests/functional/k/{ => keyword-arg-before-vararg}/keyword_arg_before_vararg.py (100%) rename tests/functional/k/{ => keyword-arg-before-vararg}/keyword_arg_before_vararg.txt (100%) rename tests/functional/l/{ => logging-format-interpolation}/logging_format_interpolation.py (100%) rename tests/functional/l/{ => logging-format-interpolation}/logging_format_interpolation.txt (100%) rename tests/functional/l/{ => logging-format-interpolation}/logging_format_interpolation_py36.py (100%) rename tests/functional/l/{ => logging-format-interpolation}/logging_format_interpolation_py36.txt (100%) rename tests/functional/l/{ => logging-format-interpolation}/logging_format_interpolation_style.py (100%) rename tests/functional/l/{ => logging-format-interpolation}/logging_format_interpolation_style.rc (100%) rename tests/functional/l/{ => logging-fstring-interpolation}/logging_fstring_interpolation_py36.py (100%) rename tests/functional/l/{ => logging-fstring-interpolation}/logging_fstring_interpolation_py36.txt (100%) rename tests/functional/l/{ => logging-fstring-interpolation}/logging_fstring_interpolation_py37.py (100%) rename tests/functional/l/{ => logging-fstring-interpolation}/logging_fstring_interpolation_py37.rc (100%) rename tests/functional/l/{ => logging-fstring-interpolation}/logging_fstring_interpolation_py37.txt (100%) rename tests/functional/l/{ => logging-not-lazy}/logging_not_lazy.py (100%) rename tests/functional/l/{ => logging-not-lazy}/logging_not_lazy.txt (100%) rename tests/functional/l/{ => logging-not-lazy}/logging_not_lazy_module.py (100%) rename tests/functional/l/{ => logging-not-lazy}/logging_not_lazy_module.rc (100%) rename tests/functional/l/{ => logging-not-lazy}/logging_not_lazy_module.txt (100%) rename tests/functional/l/{ => logging-not-lazy}/logging_not_lazy_with_logger.py (100%) rename tests/functional/l/{ => logging-not-lazy}/logging_not_lazy_with_logger.txt (100%) rename tests/functional/l/{ => logging-too-few-args}/logging_too_few_args.py (100%) rename tests/functional/l/{ => logging-too-few-args}/logging_too_few_args.rc (100%) rename tests/functional/l/{ => logging-too-few-args}/logging_too_few_args.txt (100%) rename tests/functional/l/{ => logging-too-many-args}/logging_too_many_args.py (100%) rename tests/functional/l/{ => logging-too-many-args}/logging_too_many_args.rc (100%) rename tests/functional/l/{ => logging-too-many-args}/logging_too_many_args.txt (100%) rename tests/functional/m/{ => misplaced-bare-raise}/misplaced_bare_raise.py (100%) rename tests/functional/m/{ => misplaced-bare-raise}/misplaced_bare_raise.txt (100%) rename tests/functional/m/{missing => missing-kwoa}/missing_kwoa.py (100%) rename tests/functional/m/{missing => missing-kwoa}/missing_kwoa.txt (100%) rename tests/functional/n/{no => no-member}/no_member.py (100%) rename tests/functional/n/{no => no-member}/no_member_dataclasses.py (100%) rename tests/functional/n/{no => no-member}/no_member_dataclasses.rc (100%) rename tests/functional/n/{no => no-member}/no_member_dataclasses.txt (100%) rename tests/functional/n/{no => no-member}/no_member_if_statements.py (100%) rename tests/functional/n/{no => no-member}/no_member_if_statements.txt (100%) rename tests/functional/n/{no => no-member}/no_member_imports.py (100%) rename tests/functional/n/{no => no-member}/no_member_imports.rc (100%) rename tests/functional/n/{no => no-member}/no_member_imports.txt (100%) rename tests/functional/n/{no => no-member}/no_member_nested_namedtuple.py (100%) rename tests/functional/n/{no => no-member}/no_member_nested_namedtuple.rc (100%) rename tests/functional/n/{no => no-member}/no_member_subclassed_dataclasses.py (100%) rename tests/functional/n/{no => no-member}/no_member_subclassed_dataclasses.rc (100%) rename tests/functional/n/{non => non-str-assignment-to-dunder-name}/non_str_assignment_to_dunder_name.py (100%) rename tests/functional/n/{non => non-str-assignment-to-dunder-name}/non_str_assignment_to_dunder_name.txt (100%) rename tests/functional/{m => n/not-a-mapping}/mapping_context.py (100%) rename tests/functional/{m => n/not-a-mapping}/mapping_context.txt (100%) rename tests/functional/{m => n/not-a-mapping}/mapping_context_py3.py (100%) rename tests/functional/{m => n/not-a-mapping}/mapping_context_py3.txt (100%) rename tests/functional/n/{ => not-async-context-manager}/not_async_context_manager.py (100%) rename tests/functional/n/{ => not-async-context-manager}/not_async_context_manager.txt (100%) rename tests/functional/n/{ => not-async-context-manager}/not_async_context_manager_py37.py (100%) rename tests/functional/n/{ => not-async-context-manager}/not_async_context_manager_py37.rc (100%) rename tests/functional/n/{ => not-callable}/not_callable.py (100%) rename tests/functional/n/{ => not-callable}/not_callable.txt (100%) rename tests/functional/n/{ => not-context-manager}/not_context_manager.py (100%) rename tests/functional/n/{ => not-context-manager}/not_context_manager.txt (100%) rename tests/functional/r/{raise => raising-bad-type}/raising_bad_type.py (100%) rename tests/functional/r/{raise => raising-bad-type}/raising_bad_type.txt (100%) rename tests/functional/r/{raise => raising-non-exception}/raising_non_exception.py (100%) rename tests/functional/r/{raise => raising-non-exception}/raising_non_exception.txt (100%) create mode 100644 tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.py create mode 100644 tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.txt rename tests/functional/r/{ => redundant-u-string-prefix}/redundant_u_string_prefix.py (100%) rename tests/functional/r/{ => redundant-u-string-prefix}/redundant_u_string_prefix.rc (100%) rename tests/functional/r/{ => redundant-u-string-prefix}/redundant_u_string_prefix.txt (100%) rename tests/functional/r/{ => redundant-unittest-assert}/redundant_unittest_assert.py (100%) rename tests/functional/r/{ => redundant-unittest-assert}/redundant_unittest_assert.txt (100%) rename tests/functional/r/{ => repeated-keyword}/repeated_keyword.py (100%) rename tests/functional/r/{ => repeated-keyword}/repeated_keyword.txt (100%) delete mode 100644 tests/functional/s/__init__.py rename tests/functional/s/{ => shallow-copy-environ}/shallow_copy_environ.py (100%) rename tests/functional/s/{ => shallow-copy-environ}/shallow_copy_environ.txt (100%) rename tests/functional/s/{ => subprocess-popen-preexec-fn}/subprocess_popen_preexec_fn.py (100%) rename tests/functional/s/{ => subprocess-popen-preexec-fn}/subprocess_popen_preexec_fn.txt (100%) rename tests/functional/s/{ => subprocess-run-check}/subprocess_run_check.py (100%) rename tests/functional/s/{ => subprocess-run-check}/subprocess_run_check.txt (100%) rename tests/functional/s/{ => syntax_error}/syntax_error.py (100%) rename tests/functional/s/{ => syntax_error}/syntax_error.rc (100%) rename tests/functional/s/{ => syntax_error}/syntax_error.txt (100%) rename tests/functional/s/{ => syntax_error}/syntax_error_jython.py (100%) rename tests/functional/s/{ => syntax_error}/syntax_error_jython.rc (100%) rename tests/functional/s/{ => syntax_error}/syntax_error_jython.txt (100%) rename tests/functional/t/{too => too-few-public-methods}/too_few_public_methods.py (100%) rename tests/functional/t/{too => too-few-public-methods}/too_few_public_methods.txt (100%) rename tests/functional/t/{too => too-few-public-methods}/too_few_public_methods_37.py (100%) rename tests/functional/t/{too => too-few-public-methods}/too_few_public_methods_37.rc (100%) rename tests/functional/t/{too => too-few-public-methods}/too_few_public_methods_excluded.py (100%) rename tests/functional/t/{too => too-few-public-methods}/too_few_public_methods_excluded.rc (100%) rename tests/functional/t/{too => too-few-public-methods}/too_few_public_methods_excluded.txt (100%) create mode 100644 tests/functional/t/too-many-ancestors/__init__.py rename tests/functional/t/{too => too-many-ancestors}/too_many_ancestors.py (100%) rename tests/functional/t/{too => too-many-ancestors}/too_many_ancestors.txt (100%) rename tests/functional/t/{too => too-many-ancestors}/too_many_ancestors_ignored_parents.py (100%) create mode 100644 tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.rc rename tests/functional/t/{too => too-many-ancestors}/too_many_ancestors_ignored_parents.txt (100%) rename tests/functional/t/{too => too-many-arguments}/too_many_arguments.py (100%) rename tests/functional/t/{too => too-many-arguments}/too_many_arguments.txt (100%) rename tests/functional/t/{too => too-many-arguments}/too_many_arguments_issue_1045.py (100%) rename tests/functional/t/{too => too-many-arguments}/too_many_arguments_overload.py (100%) rename tests/functional/t/{too => too-many-boolean-expressions}/too_many_boolean_expressions.py (100%) rename tests/functional/t/{too => too-many-boolean-expressions}/too_many_boolean_expressions.txt (100%) rename tests/functional/t/{too => too-many-branches}/too_many_branches.py (100%) rename tests/functional/t/{too => too-many-branches}/too_many_branches.txt (100%) rename tests/functional/t/{too => too-many-instance-attributes}/too_many_instance_attributes.py (100%) rename tests/functional/t/{too => too-many-instance-attributes}/too_many_instance_attributes.txt (100%) rename tests/functional/t/{too => too-many-instance-attributes}/too_many_instance_attributes_py37.py (100%) rename tests/functional/t/{too => too-many-instance-attributes}/too_many_instance_attributes_py37.rc (100%) rename tests/functional/t/{too => too-many-lines}/too_many_lines.py (100%) rename tests/functional/t/{too => too-many-lines}/too_many_lines.txt (100%) rename tests/functional/t/{too => too-many-lines}/too_many_lines_disabled.py (100%) rename tests/functional/t/{too => too-many-locals}/too_many_locals.py (100%) rename tests/functional/t/{too => too-many-locals}/too_many_locals.txt (100%) rename tests/functional/t/{too => too-many-nested-blocks}/too_many_nested_blocks.py (100%) rename tests/functional/t/{too => too-many-nested-blocks}/too_many_nested_blocks.txt (100%) rename tests/functional/t/{too => too-many-public-methods}/too_many_public_methods.py (100%) rename tests/functional/t/{too => too-many-public-methods}/too_many_public_methods.txt (100%) rename tests/functional/t/{too => too-many-return-statements}/too_many_return_statements.py (100%) rename tests/functional/t/{too => too-many-return-statements}/too_many_return_statements.txt (100%) rename tests/functional/t/{too => too-many-star-expressions}/too_many_star_expressions.py (100%) rename tests/functional/t/{too => too-many-star-expressions}/too_many_star_expressions.txt (100%) rename tests/functional/t/{too => too-many-statements}/too_many_statements.py (100%) rename tests/functional/t/{too => too-many-statements}/too_many_statements.rc (100%) rename tests/functional/t/{too => too-many-statements}/too_many_statements.txt (100%) delete mode 100644 tests/functional/t/too/__init__.py delete mode 100644 tests/functional/t/too/too_many_ancestors_ignored_parents.rc rename tests/functional/u/{ => unhashable-dict-key}/unhashable_dict_key.py (100%) rename tests/functional/u/{ => unhashable-dict-key}/unhashable_dict_key.txt (100%) rename tests/functional/u/{ => unrecognized-inline-option}/unrecognized_inline_option.py (100%) rename tests/functional/u/{ => unrecognized-inline-option}/unrecognized_inline_option.txt (100%) rename tests/functional/u/{ => unspecified-encoding}/unspecified_encoding_py38.py (100%) rename tests/functional/u/{ => unspecified-encoding}/unspecified_encoding_py38.rc (100%) rename tests/functional/u/{ => unspecified-encoding}/unspecified_encoding_py38.txt (100%) rename tests/functional/u/{ => unsubscriptable-object}/unsubscriptable_object.py (100%) rename tests/functional/u/{unsupported => unsupported-assignment-operation}/unsupported_assignment_operation.py (100%) rename tests/functional/u/{unsupported => unsupported-assignment-operation}/unsupported_assignment_operation.rc (100%) rename tests/functional/u/{unsupported => unsupported-assignment-operation}/unsupported_assignment_operation.txt (100%) rename tests/functional/u/{unsupported => unsupported-binary-operation}/unsupported_binary_operation.py (100%) rename tests/functional/u/{unsupported => unsupported-binary-operation}/unsupported_binary_operation.rc (100%) rename tests/functional/u/{unsupported => unsupported-binary-operation}/unsupported_binary_operation.txt (100%) rename tests/functional/u/{unsupported => unsupported-delete-operation}/unsupported_delete_operation.py (100%) rename tests/functional/u/{unsupported => unsupported-delete-operation}/unsupported_delete_operation.rc (100%) rename tests/functional/u/{unsupported => unsupported-delete-operation}/unsupported_delete_operation.txt (100%) rename tests/functional/{m/member => u/unsupported-membership-test}/membership_protocol.py (100%) rename tests/functional/{m/member => u/unsupported-membership-test}/membership_protocol.txt (100%) rename tests/functional/{m/member => u/unsupported-membership-test}/membership_protocol_py3.py (100%) rename tests/functional/{m/member => u/unsupported-membership-test}/membership_protocol_py3.txt (100%) rename tests/functional/u/{useless => useless-suppression}/useless_suppression.py (100%) rename tests/functional/y/{ => yield-inside-async-function}/yield_inside_async_function.py (100%) rename tests/functional/y/{ => yield-inside-async-function}/yield_inside_async_function.txt (100%) diff --git a/tests/functional/a/anomalous_backslash_escape.py b/tests/functional/a/anomalous-backslash-in-string/anomalous_backslash_escape.py similarity index 100% rename from tests/functional/a/anomalous_backslash_escape.py rename to tests/functional/a/anomalous-backslash-in-string/anomalous_backslash_escape.py diff --git a/tests/functional/a/anomalous_backslash_escape.txt b/tests/functional/a/anomalous-backslash-in-string/anomalous_backslash_escape.txt similarity index 100% rename from tests/functional/a/anomalous_backslash_escape.txt rename to tests/functional/a/anomalous-backslash-in-string/anomalous_backslash_escape.txt diff --git a/tests/functional/a/anomalous_unicode_escape.py b/tests/functional/a/anomalous-unicode-escape-in-string/anomalous_unicode_escape.py similarity index 100% rename from tests/functional/a/anomalous_unicode_escape.py rename to tests/functional/a/anomalous-unicode-escape-in-string/anomalous_unicode_escape.py diff --git a/tests/functional/a/anomalous_unicode_escape.txt b/tests/functional/a/anomalous-unicode-escape-in-string/anomalous_unicode_escape.txt similarity index 100% rename from tests/functional/a/anomalous_unicode_escape.txt rename to tests/functional/a/anomalous-unicode-escape-in-string/anomalous_unicode_escape.txt diff --git a/tests/functional/a/arguments_out_of_order.py b/tests/functional/a/arguments-out-of-order/arguments_out_of_order.py similarity index 100% rename from tests/functional/a/arguments_out_of_order.py rename to tests/functional/a/arguments-out-of-order/arguments_out_of_order.py diff --git a/tests/functional/a/arguments_out_of_order.txt b/tests/functional/a/arguments-out-of-order/arguments_out_of_order.txt similarity index 100% rename from tests/functional/a/arguments_out_of_order.txt rename to tests/functional/a/arguments-out-of-order/arguments_out_of_order.txt diff --git a/tests/functional/a/arguments.py b/tests/functional/a/arguments.py index df92903453..89298d6a3e 100644 --- a/tests/functional/a/arguments.py +++ b/tests/functional/a/arguments.py @@ -58,13 +58,13 @@ def function_default_arg(one=1, two=2): function_1_arg(bob=4) # [unexpected-keyword-arg,no-value-for-parameter] function_default_arg(1, 4, coin="hello") # [unexpected-keyword-arg] -function_default_arg(1, one=5) # [redundant-keyword-arg] # Remaining tests are for coverage of correct names in messages. LAMBDA = lambda arg: 1 LAMBDA() # [no-value-for-parameter] + def method_tests(): """Method invocations.""" demo = DemoClass() @@ -135,13 +135,6 @@ def test(self): Test().lam() # [no-value-for-parameter] -# Don't emit a redundant-keyword-arg for this example, -# it's perfectly valid - -class Issue642(object): - attr = 0 - def __str__(self): - return "{self.attr}".format(self=self) # These should not emit anything regarding the number of arguments, # since they have something invalid. diff --git a/tests/functional/a/arguments.txt b/tests/functional/a/arguments.txt index 400be7454b..a292e15afe 100644 --- a/tests/functional/a/arguments.txt +++ b/tests/functional/a/arguments.txt @@ -8,8 +8,7 @@ too-many-function-args:53:0:53:41::Too many positional arguments for function ca no-value-for-parameter:58:0:58:21::No value for argument 'first_argument' in function call:UNDEFINED unexpected-keyword-arg:58:0:58:21::Unexpected keyword argument 'bob' in function call:UNDEFINED unexpected-keyword-arg:59:0:59:40::Unexpected keyword argument 'coin' in function call:UNDEFINED -redundant-keyword-arg:61:0:61:30::Argument 'one' passed by position and keyword in function call:UNDEFINED -no-value-for-parameter:66:0:66:8::No value for argument 'arg' in lambda call:UNDEFINED +no-value-for-parameter:65:0:65:8::No value for argument 'arg' in lambda call:UNDEFINED no-value-for-parameter:71:4:71:24:method_tests:No value for argument 'arg' in staticmethod call:UNDEFINED no-value-for-parameter:72:4:72:29:method_tests:No value for argument 'arg' in staticmethod call:UNDEFINED no-value-for-parameter:74:4:74:23:method_tests:No value for argument 'arg' in classmethod call:UNDEFINED @@ -28,12 +27,12 @@ unexpected-keyword-arg:122:8:122:29:TypeCheckConstructor.test:Unexpected keyword no-value-for-parameter:133:8:133:18:Test.test:No value for argument 'icon' in method call:UNDEFINED too-many-function-args:134:8:134:25:Test.test:Too many positional arguments for method call:UNDEFINED no-value-for-parameter:136:0:136:12::No value for argument 'icon' in method call:UNDEFINED -no-value-for-parameter:163:4:163:29:no_context_but_redefined:No value for argument 'three' in function call:UNDEFINED -no-value-for-parameter:163:4:163:29:no_context_but_redefined:No value for argument 'two' in function call:UNDEFINED -no-value-for-parameter:166:4:166:22:no_context_one_elem:No value for argument 'three' in function call:UNDEFINED -no-value-for-parameter:166:4:166:22:no_context_one_elem:No value for argument 'two' in function call:UNDEFINED -unexpected-keyword-arg:202:23:202:56:namedtuple_replace_issue_1036:Unexpected keyword argument 'd' in method call:UNDEFINED -unexpected-keyword-arg:202:23:202:56:namedtuple_replace_issue_1036:Unexpected keyword argument 'e' in method call:UNDEFINED -no-value-for-parameter:215:0:215:24::No value for argument 'third' in function call:UNDEFINED -no-value-for-parameter:216:0:216:30::No value for argument 'second' in function call:UNDEFINED -unexpected-keyword-arg:217:0:217:43::Unexpected keyword argument 'fourth' in function call:UNDEFINED +no-value-for-parameter:156:4:156:29:no_context_but_redefined:No value for argument 'three' in function call:UNDEFINED +no-value-for-parameter:156:4:156:29:no_context_but_redefined:No value for argument 'two' in function call:UNDEFINED +no-value-for-parameter:159:4:159:22:no_context_one_elem:No value for argument 'three' in function call:UNDEFINED +no-value-for-parameter:159:4:159:22:no_context_one_elem:No value for argument 'two' in function call:UNDEFINED +unexpected-keyword-arg:195:23:195:56:namedtuple_replace_issue_1036:Unexpected keyword argument 'd' in method call:UNDEFINED +unexpected-keyword-arg:195:23:195:56:namedtuple_replace_issue_1036:Unexpected keyword argument 'e' in method call:UNDEFINED +no-value-for-parameter:208:0:208:24::No value for argument 'third' in function call:UNDEFINED +no-value-for-parameter:209:0:209:30::No value for argument 'second' in function call:UNDEFINED +unexpected-keyword-arg:210:0:210:43::Unexpected keyword argument 'fourth' in function call:UNDEFINED diff --git a/tests/functional/a/assign/assignment_from_no_return.py b/tests/functional/a/assignment-from-no-return/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-from-no-return/assignment_from_no_return.py diff --git a/tests/functional/a/assign/assignment_from_no_return.txt b/tests/functional/a/assignment-from-no-return/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-from-no-return/assignment_from_no_return.txt diff --git a/tests/functional/a/assign/assignment_from_no_return_2.py b/tests/functional/a/assignment-from-no-return/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-from-no-return/assignment_from_no_return_2.py diff --git a/tests/functional/a/assign/assignment_from_no_return_2.txt b/tests/functional/a/assignment-from-no-return/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-from-no-return/assignment_from_no_return_2.txt diff --git a/tests/functional/a/assign/assignment_from_no_return_py3.py b/tests/functional/a/assignment-from-no-return/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-from-no-return/assignment_from_no_return_py3.py diff --git a/tests/functional/a/await_outside_async.py b/tests/functional/a/await-outside-async/await_outside_async.py similarity index 100% rename from tests/functional/a/await_outside_async.py rename to tests/functional/a/await-outside-async/await_outside_async.py diff --git a/tests/functional/a/await_outside_async.rc b/tests/functional/a/await-outside-async/await_outside_async.rc similarity index 100% rename from tests/functional/a/await_outside_async.rc rename to tests/functional/a/await-outside-async/await_outside_async.rc diff --git a/tests/functional/a/await_outside_async.txt b/tests/functional/a/await-outside-async/await_outside_async.txt similarity index 100% rename from tests/functional/a/await_outside_async.txt rename to tests/functional/a/await-outside-async/await_outside_async.txt diff --git a/tests/functional/b/bad_except_order.py b/tests/functional/b/bad-except-order/bad_except_order.py similarity index 100% rename from tests/functional/b/bad_except_order.py rename to tests/functional/b/bad-except-order/bad_except_order.py diff --git a/tests/functional/b/bad_except_order.txt b/tests/functional/b/bad-except-order/bad_except_order.txt similarity index 100% rename from tests/functional/b/bad_except_order.txt rename to tests/functional/b/bad-except-order/bad_except_order.txt diff --git a/tests/functional/b/bad_exception_context.py b/tests/functional/b/bad-exception-context/bad_exception_context.py similarity index 100% rename from tests/functional/b/bad_exception_context.py rename to tests/functional/b/bad-exception-context/bad_exception_context.py diff --git a/tests/functional/b/bad_exception_context.txt b/tests/functional/b/bad-exception-context/bad_exception_context.txt similarity index 100% rename from tests/functional/b/bad_exception_context.txt rename to tests/functional/b/bad-exception-context/bad_exception_context.txt diff --git a/tests/functional/b/bad_inline_option.py b/tests/functional/b/bad-inline-option/bad_inline_option.py similarity index 100% rename from tests/functional/b/bad_inline_option.py rename to tests/functional/b/bad-inline-option/bad_inline_option.py diff --git a/tests/functional/b/bad_inline_option.rc b/tests/functional/b/bad-inline-option/bad_inline_option.rc similarity index 100% rename from tests/functional/b/bad_inline_option.rc rename to tests/functional/b/bad-inline-option/bad_inline_option.rc diff --git a/tests/functional/b/bad_inline_option.txt b/tests/functional/b/bad-inline-option/bad_inline_option.txt similarity index 100% rename from tests/functional/b/bad_inline_option.txt rename to tests/functional/b/bad-inline-option/bad_inline_option.txt diff --git a/tests/functional/b/bad_open_mode.py b/tests/functional/b/bad-open-mode/bad_open_mode.py similarity index 100% rename from tests/functional/b/bad_open_mode.py rename to tests/functional/b/bad-open-mode/bad_open_mode.py diff --git a/tests/functional/b/bad_open_mode.rc b/tests/functional/b/bad-open-mode/bad_open_mode.rc similarity index 100% rename from tests/functional/b/bad_open_mode.rc rename to tests/functional/b/bad-open-mode/bad_open_mode.rc diff --git a/tests/functional/b/bad_open_mode.txt b/tests/functional/b/bad-open-mode/bad_open_mode.txt similarity index 100% rename from tests/functional/b/bad_open_mode.txt rename to tests/functional/b/bad-open-mode/bad_open_mode.txt diff --git a/tests/functional/b/bad_option_value.py b/tests/functional/b/bad-option-value/bad_option_value.py similarity index 100% rename from tests/functional/b/bad_option_value.py rename to tests/functional/b/bad-option-value/bad_option_value.py diff --git a/tests/functional/b/bad_option_value.txt b/tests/functional/b/bad-option-value/bad_option_value.txt similarity index 100% rename from tests/functional/b/bad_option_value.txt rename to tests/functional/b/bad-option-value/bad_option_value.txt diff --git a/tests/functional/k/__init__.py b/tests/functional/b/bad-plugin-value/.gitkeep similarity index 100% rename from tests/functional/k/__init__.py rename to tests/functional/b/bad-plugin-value/.gitkeep diff --git a/tests/functional/b/bad_thread_instantiation.py b/tests/functional/b/bad-thread-instantiation/bad_thread_instantiation.py similarity index 100% rename from tests/functional/b/bad_thread_instantiation.py rename to tests/functional/b/bad-thread-instantiation/bad_thread_instantiation.py diff --git a/tests/functional/b/bad_thread_instantiation.txt b/tests/functional/b/bad-thread-instantiation/bad_thread_instantiation.txt similarity index 100% rename from tests/functional/b/bad_thread_instantiation.txt rename to tests/functional/b/bad-thread-instantiation/bad_thread_instantiation.txt diff --git a/tests/functional/d/deprecated/deprecated_class_py33.py b/tests/functional/d/deprecated-class/deprecated_class_py33.py similarity index 100% rename from tests/functional/d/deprecated/deprecated_class_py33.py rename to tests/functional/d/deprecated-class/deprecated_class_py33.py diff --git a/tests/functional/d/deprecated/deprecated_class_py33.rc b/tests/functional/d/deprecated-class/deprecated_class_py33.rc similarity index 100% rename from tests/functional/d/deprecated/deprecated_class_py33.rc rename to tests/functional/d/deprecated-class/deprecated_class_py33.rc diff --git a/tests/functional/d/deprecated/deprecated_class_py33.txt b/tests/functional/d/deprecated-class/deprecated_class_py33.txt similarity index 100% rename from tests/functional/d/deprecated/deprecated_class_py33.txt rename to tests/functional/d/deprecated-class/deprecated_class_py33.txt diff --git a/tests/functional/d/deprecated/deprecated_decorators.py b/tests/functional/d/deprecated-decorator/deprecated_decorators.py similarity index 100% rename from tests/functional/d/deprecated/deprecated_decorators.py rename to tests/functional/d/deprecated-decorator/deprecated_decorators.py diff --git a/tests/functional/d/deprecated/deprecated_decorators.txt b/tests/functional/d/deprecated-decorator/deprecated_decorators.txt similarity index 100% rename from tests/functional/d/deprecated/deprecated_decorators.txt rename to tests/functional/d/deprecated-decorator/deprecated_decorators.txt diff --git a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.py b/tests/functional/d/deprecated-method/deprecated_method_getmoduleinfo.py similarity index 100% rename from tests/functional/d/deprecated/deprecated_method_getmoduleinfo.py rename to tests/functional/d/deprecated-method/deprecated_method_getmoduleinfo.py diff --git a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.rc b/tests/functional/d/deprecated-method/deprecated_method_getmoduleinfo.rc similarity index 100% rename from tests/functional/d/deprecated/deprecated_method_getmoduleinfo.rc rename to tests/functional/d/deprecated-method/deprecated_method_getmoduleinfo.rc diff --git a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.txt b/tests/functional/d/deprecated-method/deprecated_method_getmoduleinfo.txt similarity index 100% rename from tests/functional/d/deprecated/deprecated_method_getmoduleinfo.txt rename to tests/functional/d/deprecated-method/deprecated_method_getmoduleinfo.txt diff --git a/tests/functional/d/deprecated/deprecated_methods_py3.py b/tests/functional/d/deprecated-method/deprecated_methods_py3.py similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py3.py rename to tests/functional/d/deprecated-method/deprecated_methods_py3.py diff --git a/tests/functional/d/deprecated/deprecated_methods_py3.rc b/tests/functional/d/deprecated-method/deprecated_methods_py3.rc similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py3.rc rename to tests/functional/d/deprecated-method/deprecated_methods_py3.rc diff --git a/tests/functional/d/deprecated/deprecated_methods_py3.txt b/tests/functional/d/deprecated-method/deprecated_methods_py3.txt similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py3.txt rename to tests/functional/d/deprecated-method/deprecated_methods_py3.txt diff --git a/tests/functional/d/deprecated/deprecated_methods_py36.py b/tests/functional/d/deprecated-method/deprecated_methods_py36.py similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py36.py rename to tests/functional/d/deprecated-method/deprecated_methods_py36.py diff --git a/tests/functional/d/deprecated/deprecated_methods_py36.txt b/tests/functional/d/deprecated-method/deprecated_methods_py36.txt similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py36.txt rename to tests/functional/d/deprecated-method/deprecated_methods_py36.txt diff --git a/tests/functional/d/deprecated/deprecated_methods_py38.py b/tests/functional/d/deprecated-method/deprecated_methods_py38.py similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py38.py rename to tests/functional/d/deprecated-method/deprecated_methods_py38.py diff --git a/tests/functional/d/deprecated/deprecated_methods_py38.rc b/tests/functional/d/deprecated-method/deprecated_methods_py38.rc similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py38.rc rename to tests/functional/d/deprecated-method/deprecated_methods_py38.rc diff --git a/tests/functional/d/deprecated/deprecated_methods_py38.txt b/tests/functional/d/deprecated-method/deprecated_methods_py38.txt similarity index 100% rename from tests/functional/d/deprecated/deprecated_methods_py38.txt rename to tests/functional/d/deprecated-method/deprecated_methods_py38.txt diff --git a/tests/functional/r/regression/regression_infer_call_result_3690.py b/tests/functional/d/deprecated-pragma/deprecated_pragma.py similarity index 100% rename from tests/functional/r/regression/regression_infer_call_result_3690.py rename to tests/functional/d/deprecated-pragma/deprecated_pragma.py diff --git a/tests/functional/r/regression/regression_infer_call_result_3690.txt b/tests/functional/d/deprecated-pragma/deprecated_pragma.txt similarity index 100% rename from tests/functional/r/regression/regression_infer_call_result_3690.txt rename to tests/functional/d/deprecated-pragma/deprecated_pragma.txt diff --git a/tests/functional/d/dict_iter_missing_items.py b/tests/functional/d/dict-iter-missing-items/dict_iter_missing_items.py similarity index 100% rename from tests/functional/d/dict_iter_missing_items.py rename to tests/functional/d/dict-iter-missing-items/dict_iter_missing_items.py diff --git a/tests/functional/d/dict_iter_missing_items.txt b/tests/functional/d/dict-iter-missing-items/dict_iter_missing_items.txt similarity index 100% rename from tests/functional/d/dict_iter_missing_items.txt rename to tests/functional/d/dict-iter-missing-items/dict_iter_missing_items.txt diff --git a/tests/functional/f/f_string_without_interpolation.py b/tests/functional/f/f-string-without-interpolation/f_string_without_interpolation.py similarity index 100% rename from tests/functional/f/f_string_without_interpolation.py rename to tests/functional/f/f-string-without-interpolation/f_string_without_interpolation.py diff --git a/tests/functional/f/f_string_without_interpolation.txt b/tests/functional/f/f-string-without-interpolation/f_string_without_interpolation.txt similarity index 100% rename from tests/functional/f/f_string_without_interpolation.txt rename to tests/functional/f/f-string-without-interpolation/f_string_without_interpolation.txt diff --git a/tests/functional/f/forgotten_debug_statement_py37.py b/tests/functional/f/forgotten-debug-statement/forgotten_debug_statement_py37.py similarity index 100% rename from tests/functional/f/forgotten_debug_statement_py37.py rename to tests/functional/f/forgotten-debug-statement/forgotten_debug_statement_py37.py diff --git a/tests/functional/f/forgotten_debug_statement_py37.rc b/tests/functional/f/forgotten-debug-statement/forgotten_debug_statement_py37.rc similarity index 100% rename from tests/functional/f/forgotten_debug_statement_py37.rc rename to tests/functional/f/forgotten-debug-statement/forgotten_debug_statement_py37.rc diff --git a/tests/functional/f/forgotten_debug_statement_py37.txt b/tests/functional/f/forgotten-debug-statement/forgotten_debug_statement_py37.txt similarity index 100% rename from tests/functional/f/forgotten_debug_statement_py37.txt rename to tests/functional/f/forgotten-debug-statement/forgotten_debug_statement_py37.txt diff --git a/tests/functional/i/implicit/implicit_str_concat.py b/tests/functional/i/implicit-str-concat/implicit_str_concat.py similarity index 100% rename from tests/functional/i/implicit/implicit_str_concat.py rename to tests/functional/i/implicit-str-concat/implicit_str_concat.py diff --git a/tests/functional/i/implicit/implicit_str_concat.txt b/tests/functional/i/implicit-str-concat/implicit_str_concat.txt similarity index 100% rename from tests/functional/i/implicit/implicit_str_concat.txt rename to tests/functional/i/implicit-str-concat/implicit_str_concat.txt diff --git a/tests/functional/i/implicit/implicit_str_concat_latin1.py b/tests/functional/i/implicit-str-concat/implicit_str_concat_latin1.py similarity index 100% rename from tests/functional/i/implicit/implicit_str_concat_latin1.py rename to tests/functional/i/implicit-str-concat/implicit_str_concat_latin1.py diff --git a/tests/functional/i/implicit/implicit_str_concat_multiline.py b/tests/functional/i/implicit-str-concat/implicit_str_concat_multiline.py similarity index 100% rename from tests/functional/i/implicit/implicit_str_concat_multiline.py rename to tests/functional/i/implicit-str-concat/implicit_str_concat_multiline.py diff --git a/tests/functional/i/implicit/implicit_str_concat_multiline.rc b/tests/functional/i/implicit-str-concat/implicit_str_concat_multiline.rc similarity index 100% rename from tests/functional/i/implicit/implicit_str_concat_multiline.rc rename to tests/functional/i/implicit-str-concat/implicit_str_concat_multiline.rc diff --git a/tests/functional/i/implicit/implicit_str_concat_multiline.txt b/tests/functional/i/implicit-str-concat/implicit_str_concat_multiline.txt similarity index 100% rename from tests/functional/i/implicit/implicit_str_concat_multiline.txt rename to tests/functional/i/implicit-str-concat/implicit_str_concat_multiline.txt diff --git a/tests/functional/i/implicit/implicit_str_concat_utf8.py b/tests/functional/i/implicit-str-concat/implicit_str_concat_utf8.py similarity index 100% rename from tests/functional/i/implicit/implicit_str_concat_utf8.py rename to tests/functional/i/implicit-str-concat/implicit_str_concat_utf8.py diff --git a/tests/functional/i/import_error.py b/tests/functional/i/import_error.py index a2183fcfba..edda9232e9 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_error.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..1f96871dcd 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:55::No name 'syntax_error' in module 'functional.s.syntax_error':UNDEFINED +syntax-error:33:0:None:None::Cannot import 'functional.s.syntax_error.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/inconsistent/inconsistent_quotes.py b/tests/functional/i/inconsistent-quotes/inconsistent_quotes.py similarity index 100% rename from tests/functional/i/inconsistent/inconsistent_quotes.py rename to tests/functional/i/inconsistent-quotes/inconsistent_quotes.py diff --git a/tests/functional/i/inconsistent/inconsistent_quotes.rc b/tests/functional/i/inconsistent-quotes/inconsistent_quotes.rc similarity index 100% rename from tests/functional/i/inconsistent/inconsistent_quotes.rc rename to tests/functional/i/inconsistent-quotes/inconsistent_quotes.rc diff --git a/tests/functional/i/inconsistent/inconsistent_quotes.txt b/tests/functional/i/inconsistent-quotes/inconsistent_quotes.txt similarity index 100% rename from tests/functional/i/inconsistent/inconsistent_quotes.txt rename to tests/functional/i/inconsistent-quotes/inconsistent_quotes.txt diff --git a/tests/functional/i/inconsistent/inconsistent_quotes2.py b/tests/functional/i/inconsistent-quotes/inconsistent_quotes2.py similarity index 100% rename from tests/functional/i/inconsistent/inconsistent_quotes2.py rename to tests/functional/i/inconsistent-quotes/inconsistent_quotes2.py diff --git a/tests/functional/i/inconsistent/inconsistent_quotes2.rc b/tests/functional/i/inconsistent-quotes/inconsistent_quotes2.rc similarity index 100% rename from tests/functional/i/inconsistent/inconsistent_quotes2.rc rename to tests/functional/i/inconsistent-quotes/inconsistent_quotes2.rc diff --git a/tests/functional/i/inconsistent/inconsistent_quotes2.txt b/tests/functional/i/inconsistent-quotes/inconsistent_quotes2.txt similarity index 100% rename from tests/functional/i/inconsistent/inconsistent_quotes2.txt rename to tests/functional/i/inconsistent-quotes/inconsistent_quotes2.txt diff --git a/tests/functional/i/invalid-envvar-default/invalid_envvar_default.py b/tests/functional/i/invalid-envvar-default/invalid_envvar_default.py new file mode 100644 index 0000000000..deb9d43ae0 --- /dev/null +++ b/tests/functional/i/invalid-envvar-default/invalid_envvar_default.py @@ -0,0 +1,54 @@ +# pylint: disable=useless-return,missing-docstring +from os import getenv + + +def function_returning_list(): + return [] + + +def function_returning_none(): + return None + + +def function_returning_string(): + return "Result" + + +def function_returning_bytes(): + return b"Result" + + +def deep_function_returning_string(): + return function_returning_string() + + +def deep_function_returning_bytes(): + return function_returning_bytes() + + +getenv("TEST", "value") +getenv("TEST", []) # [invalid-envvar-default] +getenv("TEST", None) +getenv("TEST", b"123") # [invalid-envvar-default] +getenv("TEST", function_returning_list()) # [invalid-envvar-default] +getenv("TEST", function_returning_none()) +getenv("TEST", function_returning_string()) +getenv("TEST", function_returning_bytes()) # [invalid-envvar-default] + +getenv("TEST", default="value") +getenv("TEST", default=[]) # [invalid-envvar-default] +getenv("TEST", default=None) +getenv("TEST", default=b"123") # [invalid-envvar-default] +getenv("TEST", default=function_returning_list()) # [invalid-envvar-default] +getenv("TEST", default=function_returning_none()) +getenv("TEST", default=function_returning_string()) +getenv("TEST", default=function_returning_bytes()) # [invalid-envvar-default] + +getenv(key="TEST") +getenv(key="TEST", default="value") +getenv(key="TEST", default=b"value") # [invalid-envvar-default] +getenv(key="TEST", default=["Crap"]) # [invalid-envvar-default] +getenv(key="TEST", default=function_returning_list()) # [invalid-envvar-default] +getenv(key="TEST", default=function_returning_none()) +getenv(key="TEST", default=function_returning_string()) +getenv(key="TEST", default=function_returning_bytes()) # [invalid-envvar-default] diff --git a/tests/functional/i/invalid-envvar-default/invalid_envvar_default.txt b/tests/functional/i/invalid-envvar-default/invalid_envvar_default.txt new file mode 100644 index 0000000000..56f8ec56bd --- /dev/null +++ b/tests/functional/i/invalid-envvar-default/invalid_envvar_default.txt @@ -0,0 +1,12 @@ +invalid-envvar-default:30:0:30:18::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED +invalid-envvar-default:32:0:32:22::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED +invalid-envvar-default:33:0:33:41::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED +invalid-envvar-default:36:0:36:42::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED +invalid-envvar-default:39:0:39:26::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED +invalid-envvar-default:41:0:41:30::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED +invalid-envvar-default:42:0:42:49::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED +invalid-envvar-default:45:0:45:50::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED +invalid-envvar-default:49:0:49:36::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED +invalid-envvar-default:50:0:50:36::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED +invalid-envvar-default:51:0:51:53::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED +invalid-envvar-default:54:0:54:54::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED diff --git a/tests/functional/i/invalid/e/invalid_envvar_value.py b/tests/functional/i/invalid-envvar-value/invalid_envvar_value.py similarity index 72% rename from tests/functional/i/invalid/e/invalid_envvar_value.py rename to tests/functional/i/invalid-envvar-value/invalid_envvar_value.py index 3c1a8882bf..d42fae0903 100644 --- a/tests/functional/i/invalid/e/invalid_envvar_value.py +++ b/tests/functional/i/invalid-envvar-value/invalid_envvar_value.py @@ -64,21 +64,3 @@ def deep_function_returning_bytes(): getenv('TEST', function_returning_none()) getenv('TEST', function_returning_string()) getenv('TEST', function_returning_bytes()) # [invalid-envvar-default] - -getenv('TEST', default="value") -getenv('TEST', default=[]) # [invalid-envvar-default] -getenv('TEST', default=None) -getenv('TEST', default=b"123") # [invalid-envvar-default] -getenv('TEST', default=function_returning_list()) # [invalid-envvar-default] -getenv('TEST', default=function_returning_none()) -getenv('TEST', default=function_returning_string()) -getenv('TEST', default=function_returning_bytes()) # [invalid-envvar-default] - -getenv(key='TEST') -getenv(key='TEST', default="value") -getenv(key='TEST', default=b"value") # [invalid-envvar-default] -getenv(key='TEST', default=["Crap"]) # [invalid-envvar-default] -getenv(key='TEST', default=function_returning_list()) # [invalid-envvar-default] -getenv(key='TEST', default=function_returning_none()) -getenv(key='TEST', default=function_returning_string()) -getenv(key='TEST', default=function_returning_bytes()) # [invalid-envvar-default] diff --git a/tests/functional/i/invalid/e/invalid_envvar_value.txt b/tests/functional/i/invalid-envvar-value/invalid_envvar_value.txt similarity index 72% rename from tests/functional/i/invalid/e/invalid_envvar_value.txt rename to tests/functional/i/invalid-envvar-value/invalid_envvar_value.txt index 21a20826e7..042257e8ea 100644 --- a/tests/functional/i/invalid/e/invalid_envvar_value.txt +++ b/tests/functional/i/invalid-envvar-value/invalid_envvar_value.txt @@ -21,11 +21,3 @@ invalid-envvar-default:60:0:60:18::os.getenv default type is builtins.list. Expe invalid-envvar-default:62:0:62:22::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED invalid-envvar-default:63:0:63:41::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED invalid-envvar-default:66:0:66:42::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED -invalid-envvar-default:69:0:69:26::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED -invalid-envvar-default:71:0:71:30::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED -invalid-envvar-default:72:0:72:49::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED -invalid-envvar-default:75:0:75:50::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED -invalid-envvar-default:79:0:79:36::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED -invalid-envvar-default:80:0:80:36::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED -invalid-envvar-default:81:0:81:53::os.getenv default type is builtins.list. Expected str or None.:UNDEFINED -invalid-envvar-default:84:0:84:54::os.getenv default type is builtins.bytes. Expected str or None.:UNDEFINED diff --git a/tests/functional/i/invalid/m/invalid_metaclass.py b/tests/functional/i/invalid-metaclass/invalid_metaclass.py similarity index 100% rename from tests/functional/i/invalid/m/invalid_metaclass.py rename to tests/functional/i/invalid-metaclass/invalid_metaclass.py diff --git a/tests/functional/i/invalid/m/invalid_metaclass.txt b/tests/functional/i/invalid-metaclass/invalid_metaclass.txt similarity index 100% rename from tests/functional/i/invalid/m/invalid_metaclass.txt rename to tests/functional/i/invalid-metaclass/invalid_metaclass.txt diff --git a/tests/functional/i/invalid/m/invalid_metaclass_py3.py b/tests/functional/i/invalid-metaclass/invalid_metaclass_py3.py similarity index 100% rename from tests/functional/i/invalid/m/invalid_metaclass_py3.py rename to tests/functional/i/invalid-metaclass/invalid_metaclass_py3.py diff --git a/tests/functional/i/invalid/s/invalid_sequence_index.py b/tests/functional/i/invalid-sequence-index/invalid_sequence_index.py similarity index 100% rename from tests/functional/i/invalid/s/invalid_sequence_index.py rename to tests/functional/i/invalid-sequence-index/invalid_sequence_index.py diff --git a/tests/functional/i/invalid/s/invalid_sequence_index.txt b/tests/functional/i/invalid-sequence-index/invalid_sequence_index.txt similarity index 100% rename from tests/functional/i/invalid/s/invalid_sequence_index.txt rename to tests/functional/i/invalid-sequence-index/invalid_sequence_index.txt diff --git a/tests/functional/i/invalid/s/invalid_slice_index.py b/tests/functional/i/invalid-slice-index/invalid_slice_index.py similarity index 100% rename from tests/functional/i/invalid/s/invalid_slice_index.py rename to tests/functional/i/invalid-slice-index/invalid_slice_index.py diff --git a/tests/functional/i/invalid/s/invalid_slice_index.txt b/tests/functional/i/invalid-slice-index/invalid_slice_index.txt similarity index 100% rename from tests/functional/i/invalid/s/invalid_slice_index.txt rename to tests/functional/i/invalid-slice-index/invalid_slice_index.txt diff --git a/tests/functional/i/invalid/invalid_unary_operand_type.py b/tests/functional/i/invalid-unary-operand-type/invalid_unary_operand_type.py similarity index 100% rename from tests/functional/i/invalid/invalid_unary_operand_type.py rename to tests/functional/i/invalid-unary-operand-type/invalid_unary_operand_type.py diff --git a/tests/functional/i/invalid/invalid_unary_operand_type.txt b/tests/functional/i/invalid-unary-operand-type/invalid_unary_operand_type.txt similarity index 100% rename from tests/functional/i/invalid/invalid_unary_operand_type.txt rename to tests/functional/i/invalid-unary-operand-type/invalid_unary_operand_type.txt diff --git a/tests/functional/i/isinstance_second_argument.py b/tests/functional/i/isinstance-second-argument-not-valid-type/isinstance_second_argument.py similarity index 100% rename from tests/functional/i/isinstance_second_argument.py rename to tests/functional/i/isinstance-second-argument-not-valid-type/isinstance_second_argument.py diff --git a/tests/functional/i/isinstance_second_argument.txt b/tests/functional/i/isinstance-second-argument-not-valid-type/isinstance_second_argument.txt similarity index 100% rename from tests/functional/i/isinstance_second_argument.txt rename to tests/functional/i/isinstance-second-argument-not-valid-type/isinstance_second_argument.txt diff --git a/tests/functional/i/iterable_context.py b/tests/functional/i/iterable_context.py index 2754d179f1..281e608670 100644 --- a/tests/functional/i/iterable_context.py +++ b/tests/functional/i/iterable_context.py @@ -1,8 +1,8 @@ -""" -Checks that primitive values are not used in an -iterating/mapping context. -""" -# pylint: disable=missing-docstring,invalid-name,too-few-public-methods,no-init,no-self-use,import-error,unused-argument,bad-mcs-method-argument,wrong-import-position,no-else-return, useless-object-inheritance, unnecessary-comprehension,redundant-u-string-prefix +"""Checks that primitive values are not used in an iterating/mapping context.""" +# pylint: disable=missing-docstring,invalid-name,too-few-public-methods,no-init,no-self-use,import-error, +# pylint: disable=unused-argument,bad-mcs-method-argument,wrong-import-position,no-else-return +# pylint: disable=useless-object-inheritance, unnecessary-comprehension,redundant-u-string-prefix + from __future__ import print_function # primitives diff --git a/tests/functional/k/keyword_arg_before_vararg.py b/tests/functional/k/keyword-arg-before-vararg/keyword_arg_before_vararg.py similarity index 100% rename from tests/functional/k/keyword_arg_before_vararg.py rename to tests/functional/k/keyword-arg-before-vararg/keyword_arg_before_vararg.py diff --git a/tests/functional/k/keyword_arg_before_vararg.txt b/tests/functional/k/keyword-arg-before-vararg/keyword_arg_before_vararg.txt similarity index 100% rename from tests/functional/k/keyword_arg_before_vararg.txt rename to tests/functional/k/keyword-arg-before-vararg/keyword_arg_before_vararg.txt diff --git a/tests/functional/l/logging_format_interpolation.py b/tests/functional/l/logging-format-interpolation/logging_format_interpolation.py similarity index 100% rename from tests/functional/l/logging_format_interpolation.py rename to tests/functional/l/logging-format-interpolation/logging_format_interpolation.py diff --git a/tests/functional/l/logging_format_interpolation.txt b/tests/functional/l/logging-format-interpolation/logging_format_interpolation.txt similarity index 100% rename from tests/functional/l/logging_format_interpolation.txt rename to tests/functional/l/logging-format-interpolation/logging_format_interpolation.txt diff --git a/tests/functional/l/logging_format_interpolation_py36.py b/tests/functional/l/logging-format-interpolation/logging_format_interpolation_py36.py similarity index 100% rename from tests/functional/l/logging_format_interpolation_py36.py rename to tests/functional/l/logging-format-interpolation/logging_format_interpolation_py36.py diff --git a/tests/functional/l/logging_format_interpolation_py36.txt b/tests/functional/l/logging-format-interpolation/logging_format_interpolation_py36.txt similarity index 100% rename from tests/functional/l/logging_format_interpolation_py36.txt rename to tests/functional/l/logging-format-interpolation/logging_format_interpolation_py36.txt diff --git a/tests/functional/l/logging_format_interpolation_style.py b/tests/functional/l/logging-format-interpolation/logging_format_interpolation_style.py similarity index 100% rename from tests/functional/l/logging_format_interpolation_style.py rename to tests/functional/l/logging-format-interpolation/logging_format_interpolation_style.py diff --git a/tests/functional/l/logging_format_interpolation_style.rc b/tests/functional/l/logging-format-interpolation/logging_format_interpolation_style.rc similarity index 100% rename from tests/functional/l/logging_format_interpolation_style.rc rename to tests/functional/l/logging-format-interpolation/logging_format_interpolation_style.rc diff --git a/tests/functional/l/logging_fstring_interpolation_py36.py b/tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py36.py similarity index 100% rename from tests/functional/l/logging_fstring_interpolation_py36.py rename to tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py36.py diff --git a/tests/functional/l/logging_fstring_interpolation_py36.txt b/tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py36.txt similarity index 100% rename from tests/functional/l/logging_fstring_interpolation_py36.txt rename to tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py36.txt diff --git a/tests/functional/l/logging_fstring_interpolation_py37.py b/tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py37.py similarity index 100% rename from tests/functional/l/logging_fstring_interpolation_py37.py rename to tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py37.py diff --git a/tests/functional/l/logging_fstring_interpolation_py37.rc b/tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py37.rc similarity index 100% rename from tests/functional/l/logging_fstring_interpolation_py37.rc rename to tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py37.rc diff --git a/tests/functional/l/logging_fstring_interpolation_py37.txt b/tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py37.txt similarity index 100% rename from tests/functional/l/logging_fstring_interpolation_py37.txt rename to tests/functional/l/logging-fstring-interpolation/logging_fstring_interpolation_py37.txt diff --git a/tests/functional/l/logging_not_lazy.py b/tests/functional/l/logging-not-lazy/logging_not_lazy.py similarity index 100% rename from tests/functional/l/logging_not_lazy.py rename to tests/functional/l/logging-not-lazy/logging_not_lazy.py diff --git a/tests/functional/l/logging_not_lazy.txt b/tests/functional/l/logging-not-lazy/logging_not_lazy.txt similarity index 100% rename from tests/functional/l/logging_not_lazy.txt rename to tests/functional/l/logging-not-lazy/logging_not_lazy.txt diff --git a/tests/functional/l/logging_not_lazy_module.py b/tests/functional/l/logging-not-lazy/logging_not_lazy_module.py similarity index 100% rename from tests/functional/l/logging_not_lazy_module.py rename to tests/functional/l/logging-not-lazy/logging_not_lazy_module.py diff --git a/tests/functional/l/logging_not_lazy_module.rc b/tests/functional/l/logging-not-lazy/logging_not_lazy_module.rc similarity index 100% rename from tests/functional/l/logging_not_lazy_module.rc rename to tests/functional/l/logging-not-lazy/logging_not_lazy_module.rc diff --git a/tests/functional/l/logging_not_lazy_module.txt b/tests/functional/l/logging-not-lazy/logging_not_lazy_module.txt similarity index 100% rename from tests/functional/l/logging_not_lazy_module.txt rename to tests/functional/l/logging-not-lazy/logging_not_lazy_module.txt diff --git a/tests/functional/l/logging_not_lazy_with_logger.py b/tests/functional/l/logging-not-lazy/logging_not_lazy_with_logger.py similarity index 100% rename from tests/functional/l/logging_not_lazy_with_logger.py rename to tests/functional/l/logging-not-lazy/logging_not_lazy_with_logger.py diff --git a/tests/functional/l/logging_not_lazy_with_logger.txt b/tests/functional/l/logging-not-lazy/logging_not_lazy_with_logger.txt similarity index 100% rename from tests/functional/l/logging_not_lazy_with_logger.txt rename to tests/functional/l/logging-not-lazy/logging_not_lazy_with_logger.txt diff --git a/tests/functional/l/logging_too_few_args.py b/tests/functional/l/logging-too-few-args/logging_too_few_args.py similarity index 100% rename from tests/functional/l/logging_too_few_args.py rename to tests/functional/l/logging-too-few-args/logging_too_few_args.py diff --git a/tests/functional/l/logging_too_few_args.rc b/tests/functional/l/logging-too-few-args/logging_too_few_args.rc similarity index 100% rename from tests/functional/l/logging_too_few_args.rc rename to tests/functional/l/logging-too-few-args/logging_too_few_args.rc diff --git a/tests/functional/l/logging_too_few_args.txt b/tests/functional/l/logging-too-few-args/logging_too_few_args.txt similarity index 100% rename from tests/functional/l/logging_too_few_args.txt rename to tests/functional/l/logging-too-few-args/logging_too_few_args.txt diff --git a/tests/functional/l/logging_too_many_args.py b/tests/functional/l/logging-too-many-args/logging_too_many_args.py similarity index 100% rename from tests/functional/l/logging_too_many_args.py rename to tests/functional/l/logging-too-many-args/logging_too_many_args.py diff --git a/tests/functional/l/logging_too_many_args.rc b/tests/functional/l/logging-too-many-args/logging_too_many_args.rc similarity index 100% rename from tests/functional/l/logging_too_many_args.rc rename to tests/functional/l/logging-too-many-args/logging_too_many_args.rc diff --git a/tests/functional/l/logging_too_many_args.txt b/tests/functional/l/logging-too-many-args/logging_too_many_args.txt similarity index 100% rename from tests/functional/l/logging_too_many_args.txt rename to tests/functional/l/logging-too-many-args/logging_too_many_args.txt diff --git a/tests/functional/m/misplaced_bare_raise.py b/tests/functional/m/misplaced-bare-raise/misplaced_bare_raise.py similarity index 100% rename from tests/functional/m/misplaced_bare_raise.py rename to tests/functional/m/misplaced-bare-raise/misplaced_bare_raise.py diff --git a/tests/functional/m/misplaced_bare_raise.txt b/tests/functional/m/misplaced-bare-raise/misplaced_bare_raise.txt similarity index 100% rename from tests/functional/m/misplaced_bare_raise.txt rename to tests/functional/m/misplaced-bare-raise/misplaced_bare_raise.txt diff --git a/tests/functional/m/missing/missing_kwoa.py b/tests/functional/m/missing-kwoa/missing_kwoa.py similarity index 100% rename from tests/functional/m/missing/missing_kwoa.py rename to tests/functional/m/missing-kwoa/missing_kwoa.py diff --git a/tests/functional/m/missing/missing_kwoa.txt b/tests/functional/m/missing-kwoa/missing_kwoa.txt similarity index 100% rename from tests/functional/m/missing/missing_kwoa.txt rename to tests/functional/m/missing-kwoa/missing_kwoa.txt diff --git a/tests/functional/n/no/no_member.py b/tests/functional/n/no-member/no_member.py similarity index 100% rename from tests/functional/n/no/no_member.py rename to tests/functional/n/no-member/no_member.py diff --git a/tests/functional/n/no/no_member_dataclasses.py b/tests/functional/n/no-member/no_member_dataclasses.py similarity index 100% rename from tests/functional/n/no/no_member_dataclasses.py rename to tests/functional/n/no-member/no_member_dataclasses.py diff --git a/tests/functional/n/no/no_member_dataclasses.rc b/tests/functional/n/no-member/no_member_dataclasses.rc similarity index 100% rename from tests/functional/n/no/no_member_dataclasses.rc rename to tests/functional/n/no-member/no_member_dataclasses.rc diff --git a/tests/functional/n/no/no_member_dataclasses.txt b/tests/functional/n/no-member/no_member_dataclasses.txt similarity index 100% rename from tests/functional/n/no/no_member_dataclasses.txt rename to tests/functional/n/no-member/no_member_dataclasses.txt diff --git a/tests/functional/n/no/no_member_if_statements.py b/tests/functional/n/no-member/no_member_if_statements.py similarity index 100% rename from tests/functional/n/no/no_member_if_statements.py rename to tests/functional/n/no-member/no_member_if_statements.py diff --git a/tests/functional/n/no/no_member_if_statements.txt b/tests/functional/n/no-member/no_member_if_statements.txt similarity index 100% rename from tests/functional/n/no/no_member_if_statements.txt rename to tests/functional/n/no-member/no_member_if_statements.txt diff --git a/tests/functional/n/no/no_member_imports.py b/tests/functional/n/no-member/no_member_imports.py similarity index 100% rename from tests/functional/n/no/no_member_imports.py rename to tests/functional/n/no-member/no_member_imports.py diff --git a/tests/functional/n/no/no_member_imports.rc b/tests/functional/n/no-member/no_member_imports.rc similarity index 100% rename from tests/functional/n/no/no_member_imports.rc rename to tests/functional/n/no-member/no_member_imports.rc diff --git a/tests/functional/n/no/no_member_imports.txt b/tests/functional/n/no-member/no_member_imports.txt similarity index 100% rename from tests/functional/n/no/no_member_imports.txt rename to tests/functional/n/no-member/no_member_imports.txt diff --git a/tests/functional/n/no/no_member_nested_namedtuple.py b/tests/functional/n/no-member/no_member_nested_namedtuple.py similarity index 100% rename from tests/functional/n/no/no_member_nested_namedtuple.py rename to tests/functional/n/no-member/no_member_nested_namedtuple.py diff --git a/tests/functional/n/no/no_member_nested_namedtuple.rc b/tests/functional/n/no-member/no_member_nested_namedtuple.rc similarity index 100% rename from tests/functional/n/no/no_member_nested_namedtuple.rc rename to tests/functional/n/no-member/no_member_nested_namedtuple.rc diff --git a/tests/functional/n/no/no_member_subclassed_dataclasses.py b/tests/functional/n/no-member/no_member_subclassed_dataclasses.py similarity index 100% rename from tests/functional/n/no/no_member_subclassed_dataclasses.py rename to tests/functional/n/no-member/no_member_subclassed_dataclasses.py diff --git a/tests/functional/n/no/no_member_subclassed_dataclasses.rc b/tests/functional/n/no-member/no_member_subclassed_dataclasses.rc similarity index 100% rename from tests/functional/n/no/no_member_subclassed_dataclasses.rc rename to tests/functional/n/no-member/no_member_subclassed_dataclasses.rc diff --git a/tests/functional/n/non/non_str_assignment_to_dunder_name.py b/tests/functional/n/non-str-assignment-to-dunder-name/non_str_assignment_to_dunder_name.py similarity index 100% rename from tests/functional/n/non/non_str_assignment_to_dunder_name.py rename to tests/functional/n/non-str-assignment-to-dunder-name/non_str_assignment_to_dunder_name.py diff --git a/tests/functional/n/non/non_str_assignment_to_dunder_name.txt b/tests/functional/n/non-str-assignment-to-dunder-name/non_str_assignment_to_dunder_name.txt similarity index 100% rename from tests/functional/n/non/non_str_assignment_to_dunder_name.txt rename to tests/functional/n/non-str-assignment-to-dunder-name/non_str_assignment_to_dunder_name.txt diff --git a/tests/functional/m/mapping_context.py b/tests/functional/n/not-a-mapping/mapping_context.py similarity index 100% rename from tests/functional/m/mapping_context.py rename to tests/functional/n/not-a-mapping/mapping_context.py diff --git a/tests/functional/m/mapping_context.txt b/tests/functional/n/not-a-mapping/mapping_context.txt similarity index 100% rename from tests/functional/m/mapping_context.txt rename to tests/functional/n/not-a-mapping/mapping_context.txt diff --git a/tests/functional/m/mapping_context_py3.py b/tests/functional/n/not-a-mapping/mapping_context_py3.py similarity index 100% rename from tests/functional/m/mapping_context_py3.py rename to tests/functional/n/not-a-mapping/mapping_context_py3.py diff --git a/tests/functional/m/mapping_context_py3.txt b/tests/functional/n/not-a-mapping/mapping_context_py3.txt similarity index 100% rename from tests/functional/m/mapping_context_py3.txt rename to tests/functional/n/not-a-mapping/mapping_context_py3.txt diff --git a/tests/functional/n/not_async_context_manager.py b/tests/functional/n/not-async-context-manager/not_async_context_manager.py similarity index 100% rename from tests/functional/n/not_async_context_manager.py rename to tests/functional/n/not-async-context-manager/not_async_context_manager.py diff --git a/tests/functional/n/not_async_context_manager.txt b/tests/functional/n/not-async-context-manager/not_async_context_manager.txt similarity index 100% rename from tests/functional/n/not_async_context_manager.txt rename to tests/functional/n/not-async-context-manager/not_async_context_manager.txt diff --git a/tests/functional/n/not_async_context_manager_py37.py b/tests/functional/n/not-async-context-manager/not_async_context_manager_py37.py similarity index 100% rename from tests/functional/n/not_async_context_manager_py37.py rename to tests/functional/n/not-async-context-manager/not_async_context_manager_py37.py diff --git a/tests/functional/n/not_async_context_manager_py37.rc b/tests/functional/n/not-async-context-manager/not_async_context_manager_py37.rc similarity index 100% rename from tests/functional/n/not_async_context_manager_py37.rc rename to tests/functional/n/not-async-context-manager/not_async_context_manager_py37.rc diff --git a/tests/functional/n/not_callable.py b/tests/functional/n/not-callable/not_callable.py similarity index 100% rename from tests/functional/n/not_callable.py rename to tests/functional/n/not-callable/not_callable.py diff --git a/tests/functional/n/not_callable.txt b/tests/functional/n/not-callable/not_callable.txt similarity index 100% rename from tests/functional/n/not_callable.txt rename to tests/functional/n/not-callable/not_callable.txt diff --git a/tests/functional/n/not_context_manager.py b/tests/functional/n/not-context-manager/not_context_manager.py similarity index 100% rename from tests/functional/n/not_context_manager.py rename to tests/functional/n/not-context-manager/not_context_manager.py diff --git a/tests/functional/n/not_context_manager.txt b/tests/functional/n/not-context-manager/not_context_manager.txt similarity index 100% rename from tests/functional/n/not_context_manager.txt rename to tests/functional/n/not-context-manager/not_context_manager.txt diff --git a/tests/functional/r/raise/raising_bad_type.py b/tests/functional/r/raising-bad-type/raising_bad_type.py similarity index 100% rename from tests/functional/r/raise/raising_bad_type.py rename to tests/functional/r/raising-bad-type/raising_bad_type.py diff --git a/tests/functional/r/raise/raising_bad_type.txt b/tests/functional/r/raising-bad-type/raising_bad_type.txt similarity index 100% rename from tests/functional/r/raise/raising_bad_type.txt rename to tests/functional/r/raising-bad-type/raising_bad_type.txt diff --git a/tests/functional/r/raise/raising_non_exception.py b/tests/functional/r/raising-non-exception/raising_non_exception.py similarity index 100% rename from tests/functional/r/raise/raising_non_exception.py rename to tests/functional/r/raising-non-exception/raising_non_exception.py diff --git a/tests/functional/r/raise/raising_non_exception.txt b/tests/functional/r/raising-non-exception/raising_non_exception.txt similarity index 100% rename from tests/functional/r/raise/raising_non_exception.txt rename to tests/functional/r/raising-non-exception/raising_non_exception.txt diff --git a/tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.py b/tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.py new file mode 100644 index 0000000000..1288d3c94b --- /dev/null +++ b/tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.py @@ -0,0 +1,19 @@ +# pylint: disable=missing-docstring, too-few-public-methods,useless-object-inheritance, consider-using-f-string + + +def function_default_arg(one=1, two=2): + """function with default value""" + return two, one + + +function_default_arg(1, one=5) # [redundant-keyword-arg] + +# Don't emit a redundant-keyword-arg for this example, +# it's perfectly valid + + +class Issue642(object): + attr = 0 + + def __str__(self): + return "{self.attr}".format(self=self) diff --git a/tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.txt b/tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.txt new file mode 100644 index 0000000000..9660ef60d2 --- /dev/null +++ b/tests/functional/r/redundant-keyword-arg/redundant_keyword_arg.txt @@ -0,0 +1 @@ +redundant-keyword-arg:9:0:9:30::Argument 'one' passed by position and keyword in function call:UNDEFINED diff --git a/tests/functional/r/redundant_u_string_prefix.py b/tests/functional/r/redundant-u-string-prefix/redundant_u_string_prefix.py similarity index 100% rename from tests/functional/r/redundant_u_string_prefix.py rename to tests/functional/r/redundant-u-string-prefix/redundant_u_string_prefix.py diff --git a/tests/functional/r/redundant_u_string_prefix.rc b/tests/functional/r/redundant-u-string-prefix/redundant_u_string_prefix.rc similarity index 100% rename from tests/functional/r/redundant_u_string_prefix.rc rename to tests/functional/r/redundant-u-string-prefix/redundant_u_string_prefix.rc diff --git a/tests/functional/r/redundant_u_string_prefix.txt b/tests/functional/r/redundant-u-string-prefix/redundant_u_string_prefix.txt similarity index 100% rename from tests/functional/r/redundant_u_string_prefix.txt rename to tests/functional/r/redundant-u-string-prefix/redundant_u_string_prefix.txt diff --git a/tests/functional/r/redundant_unittest_assert.py b/tests/functional/r/redundant-unittest-assert/redundant_unittest_assert.py similarity index 100% rename from tests/functional/r/redundant_unittest_assert.py rename to tests/functional/r/redundant-unittest-assert/redundant_unittest_assert.py diff --git a/tests/functional/r/redundant_unittest_assert.txt b/tests/functional/r/redundant-unittest-assert/redundant_unittest_assert.txt similarity index 100% rename from tests/functional/r/redundant_unittest_assert.txt rename to tests/functional/r/redundant-unittest-assert/redundant_unittest_assert.txt diff --git a/tests/functional/r/repeated_keyword.py b/tests/functional/r/repeated-keyword/repeated_keyword.py similarity index 100% rename from tests/functional/r/repeated_keyword.py rename to tests/functional/r/repeated-keyword/repeated_keyword.py diff --git a/tests/functional/r/repeated_keyword.txt b/tests/functional/r/repeated-keyword/repeated_keyword.txt similarity index 100% rename from tests/functional/r/repeated_keyword.txt rename to tests/functional/r/repeated-keyword/repeated_keyword.txt diff --git a/tests/functional/s/__init__.py b/tests/functional/s/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/functional/s/shallow_copy_environ.py b/tests/functional/s/shallow-copy-environ/shallow_copy_environ.py similarity index 100% rename from tests/functional/s/shallow_copy_environ.py rename to tests/functional/s/shallow-copy-environ/shallow_copy_environ.py diff --git a/tests/functional/s/shallow_copy_environ.txt b/tests/functional/s/shallow-copy-environ/shallow_copy_environ.txt similarity index 100% rename from tests/functional/s/shallow_copy_environ.txt rename to tests/functional/s/shallow-copy-environ/shallow_copy_environ.txt diff --git a/tests/functional/s/subprocess_popen_preexec_fn.py b/tests/functional/s/subprocess-popen-preexec-fn/subprocess_popen_preexec_fn.py similarity index 100% rename from tests/functional/s/subprocess_popen_preexec_fn.py rename to tests/functional/s/subprocess-popen-preexec-fn/subprocess_popen_preexec_fn.py diff --git a/tests/functional/s/subprocess_popen_preexec_fn.txt b/tests/functional/s/subprocess-popen-preexec-fn/subprocess_popen_preexec_fn.txt similarity index 100% rename from tests/functional/s/subprocess_popen_preexec_fn.txt rename to tests/functional/s/subprocess-popen-preexec-fn/subprocess_popen_preexec_fn.txt diff --git a/tests/functional/s/subprocess_run_check.py b/tests/functional/s/subprocess-run-check/subprocess_run_check.py similarity index 100% rename from tests/functional/s/subprocess_run_check.py rename to tests/functional/s/subprocess-run-check/subprocess_run_check.py diff --git a/tests/functional/s/subprocess_run_check.txt b/tests/functional/s/subprocess-run-check/subprocess_run_check.txt similarity index 100% rename from tests/functional/s/subprocess_run_check.txt rename to tests/functional/s/subprocess-run-check/subprocess_run_check.txt diff --git a/tests/functional/s/syntax_error.py b/tests/functional/s/syntax_error/syntax_error.py similarity index 100% rename from tests/functional/s/syntax_error.py rename to tests/functional/s/syntax_error/syntax_error.py diff --git a/tests/functional/s/syntax_error.rc b/tests/functional/s/syntax_error/syntax_error.rc similarity index 100% rename from tests/functional/s/syntax_error.rc rename to tests/functional/s/syntax_error/syntax_error.rc diff --git a/tests/functional/s/syntax_error.txt b/tests/functional/s/syntax_error/syntax_error.txt similarity index 100% rename from tests/functional/s/syntax_error.txt rename to tests/functional/s/syntax_error/syntax_error.txt diff --git a/tests/functional/s/syntax_error_jython.py b/tests/functional/s/syntax_error/syntax_error_jython.py similarity index 100% rename from tests/functional/s/syntax_error_jython.py rename to tests/functional/s/syntax_error/syntax_error_jython.py diff --git a/tests/functional/s/syntax_error_jython.rc b/tests/functional/s/syntax_error/syntax_error_jython.rc similarity index 100% rename from tests/functional/s/syntax_error_jython.rc rename to tests/functional/s/syntax_error/syntax_error_jython.rc diff --git a/tests/functional/s/syntax_error_jython.txt b/tests/functional/s/syntax_error/syntax_error_jython.txt similarity index 100% rename from tests/functional/s/syntax_error_jython.txt rename to tests/functional/s/syntax_error/syntax_error_jython.txt diff --git a/tests/functional/t/too/too_few_public_methods.py b/tests/functional/t/too-few-public-methods/too_few_public_methods.py similarity index 100% rename from tests/functional/t/too/too_few_public_methods.py rename to tests/functional/t/too-few-public-methods/too_few_public_methods.py diff --git a/tests/functional/t/too/too_few_public_methods.txt b/tests/functional/t/too-few-public-methods/too_few_public_methods.txt similarity index 100% rename from tests/functional/t/too/too_few_public_methods.txt rename to tests/functional/t/too-few-public-methods/too_few_public_methods.txt diff --git a/tests/functional/t/too/too_few_public_methods_37.py b/tests/functional/t/too-few-public-methods/too_few_public_methods_37.py similarity index 100% rename from tests/functional/t/too/too_few_public_methods_37.py rename to tests/functional/t/too-few-public-methods/too_few_public_methods_37.py diff --git a/tests/functional/t/too/too_few_public_methods_37.rc b/tests/functional/t/too-few-public-methods/too_few_public_methods_37.rc similarity index 100% rename from tests/functional/t/too/too_few_public_methods_37.rc rename to tests/functional/t/too-few-public-methods/too_few_public_methods_37.rc diff --git a/tests/functional/t/too/too_few_public_methods_excluded.py b/tests/functional/t/too-few-public-methods/too_few_public_methods_excluded.py similarity index 100% rename from tests/functional/t/too/too_few_public_methods_excluded.py rename to tests/functional/t/too-few-public-methods/too_few_public_methods_excluded.py diff --git a/tests/functional/t/too/too_few_public_methods_excluded.rc b/tests/functional/t/too-few-public-methods/too_few_public_methods_excluded.rc similarity index 100% rename from tests/functional/t/too/too_few_public_methods_excluded.rc rename to tests/functional/t/too-few-public-methods/too_few_public_methods_excluded.rc diff --git a/tests/functional/t/too/too_few_public_methods_excluded.txt b/tests/functional/t/too-few-public-methods/too_few_public_methods_excluded.txt similarity index 100% rename from tests/functional/t/too/too_few_public_methods_excluded.txt rename to tests/functional/t/too-few-public-methods/too_few_public_methods_excluded.txt diff --git a/tests/functional/t/too-many-ancestors/__init__.py b/tests/functional/t/too-many-ancestors/__init__.py new file mode 100644 index 0000000000..495ed16599 --- /dev/null +++ b/tests/functional/t/too-many-ancestors/__init__.py @@ -0,0 +1 @@ +# Required for ignored-parents option in too_many_ancestors_ignored_parents.py diff --git a/tests/functional/t/too/too_many_ancestors.py b/tests/functional/t/too-many-ancestors/too_many_ancestors.py similarity index 100% rename from tests/functional/t/too/too_many_ancestors.py rename to tests/functional/t/too-many-ancestors/too_many_ancestors.py diff --git a/tests/functional/t/too/too_many_ancestors.txt b/tests/functional/t/too-many-ancestors/too_many_ancestors.txt similarity index 100% rename from tests/functional/t/too/too_many_ancestors.txt rename to tests/functional/t/too-many-ancestors/too_many_ancestors.txt diff --git a/tests/functional/t/too/too_many_ancestors_ignored_parents.py b/tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.py similarity index 100% rename from tests/functional/t/too/too_many_ancestors_ignored_parents.py rename to tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.py diff --git a/tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.rc b/tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.rc new file mode 100644 index 0000000000..3b97bbfe1c --- /dev/null +++ b/tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.rc @@ -0,0 +1,3 @@ +[DESIGN] +max-parents=2 +ignored-parents=functional.t.too-many-ancestors.too_many_ancestors_ignored_parents.E diff --git a/tests/functional/t/too/too_many_ancestors_ignored_parents.txt b/tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.txt similarity index 100% rename from tests/functional/t/too/too_many_ancestors_ignored_parents.txt rename to tests/functional/t/too-many-ancestors/too_many_ancestors_ignored_parents.txt diff --git a/tests/functional/t/too/too_many_arguments.py b/tests/functional/t/too-many-arguments/too_many_arguments.py similarity index 100% rename from tests/functional/t/too/too_many_arguments.py rename to tests/functional/t/too-many-arguments/too_many_arguments.py diff --git a/tests/functional/t/too/too_many_arguments.txt b/tests/functional/t/too-many-arguments/too_many_arguments.txt similarity index 100% rename from tests/functional/t/too/too_many_arguments.txt rename to tests/functional/t/too-many-arguments/too_many_arguments.txt diff --git a/tests/functional/t/too/too_many_arguments_issue_1045.py b/tests/functional/t/too-many-arguments/too_many_arguments_issue_1045.py similarity index 100% rename from tests/functional/t/too/too_many_arguments_issue_1045.py rename to tests/functional/t/too-many-arguments/too_many_arguments_issue_1045.py diff --git a/tests/functional/t/too/too_many_arguments_overload.py b/tests/functional/t/too-many-arguments/too_many_arguments_overload.py similarity index 100% rename from tests/functional/t/too/too_many_arguments_overload.py rename to tests/functional/t/too-many-arguments/too_many_arguments_overload.py diff --git a/tests/functional/t/too/too_many_boolean_expressions.py b/tests/functional/t/too-many-boolean-expressions/too_many_boolean_expressions.py similarity index 100% rename from tests/functional/t/too/too_many_boolean_expressions.py rename to tests/functional/t/too-many-boolean-expressions/too_many_boolean_expressions.py diff --git a/tests/functional/t/too/too_many_boolean_expressions.txt b/tests/functional/t/too-many-boolean-expressions/too_many_boolean_expressions.txt similarity index 100% rename from tests/functional/t/too/too_many_boolean_expressions.txt rename to tests/functional/t/too-many-boolean-expressions/too_many_boolean_expressions.txt diff --git a/tests/functional/t/too/too_many_branches.py b/tests/functional/t/too-many-branches/too_many_branches.py similarity index 100% rename from tests/functional/t/too/too_many_branches.py rename to tests/functional/t/too-many-branches/too_many_branches.py diff --git a/tests/functional/t/too/too_many_branches.txt b/tests/functional/t/too-many-branches/too_many_branches.txt similarity index 100% rename from tests/functional/t/too/too_many_branches.txt rename to tests/functional/t/too-many-branches/too_many_branches.txt diff --git a/tests/functional/t/too/too_many_instance_attributes.py b/tests/functional/t/too-many-instance-attributes/too_many_instance_attributes.py similarity index 100% rename from tests/functional/t/too/too_many_instance_attributes.py rename to tests/functional/t/too-many-instance-attributes/too_many_instance_attributes.py diff --git a/tests/functional/t/too/too_many_instance_attributes.txt b/tests/functional/t/too-many-instance-attributes/too_many_instance_attributes.txt similarity index 100% rename from tests/functional/t/too/too_many_instance_attributes.txt rename to tests/functional/t/too-many-instance-attributes/too_many_instance_attributes.txt diff --git a/tests/functional/t/too/too_many_instance_attributes_py37.py b/tests/functional/t/too-many-instance-attributes/too_many_instance_attributes_py37.py similarity index 100% rename from tests/functional/t/too/too_many_instance_attributes_py37.py rename to tests/functional/t/too-many-instance-attributes/too_many_instance_attributes_py37.py diff --git a/tests/functional/t/too/too_many_instance_attributes_py37.rc b/tests/functional/t/too-many-instance-attributes/too_many_instance_attributes_py37.rc similarity index 100% rename from tests/functional/t/too/too_many_instance_attributes_py37.rc rename to tests/functional/t/too-many-instance-attributes/too_many_instance_attributes_py37.rc diff --git a/tests/functional/t/too/too_many_lines.py b/tests/functional/t/too-many-lines/too_many_lines.py similarity index 100% rename from tests/functional/t/too/too_many_lines.py rename to tests/functional/t/too-many-lines/too_many_lines.py diff --git a/tests/functional/t/too/too_many_lines.txt b/tests/functional/t/too-many-lines/too_many_lines.txt similarity index 100% rename from tests/functional/t/too/too_many_lines.txt rename to tests/functional/t/too-many-lines/too_many_lines.txt diff --git a/tests/functional/t/too/too_many_lines_disabled.py b/tests/functional/t/too-many-lines/too_many_lines_disabled.py similarity index 100% rename from tests/functional/t/too/too_many_lines_disabled.py rename to tests/functional/t/too-many-lines/too_many_lines_disabled.py diff --git a/tests/functional/t/too/too_many_locals.py b/tests/functional/t/too-many-locals/too_many_locals.py similarity index 100% rename from tests/functional/t/too/too_many_locals.py rename to tests/functional/t/too-many-locals/too_many_locals.py diff --git a/tests/functional/t/too/too_many_locals.txt b/tests/functional/t/too-many-locals/too_many_locals.txt similarity index 100% rename from tests/functional/t/too/too_many_locals.txt rename to tests/functional/t/too-many-locals/too_many_locals.txt diff --git a/tests/functional/t/too/too_many_nested_blocks.py b/tests/functional/t/too-many-nested-blocks/too_many_nested_blocks.py similarity index 100% rename from tests/functional/t/too/too_many_nested_blocks.py rename to tests/functional/t/too-many-nested-blocks/too_many_nested_blocks.py diff --git a/tests/functional/t/too/too_many_nested_blocks.txt b/tests/functional/t/too-many-nested-blocks/too_many_nested_blocks.txt similarity index 100% rename from tests/functional/t/too/too_many_nested_blocks.txt rename to tests/functional/t/too-many-nested-blocks/too_many_nested_blocks.txt diff --git a/tests/functional/t/too/too_many_public_methods.py b/tests/functional/t/too-many-public-methods/too_many_public_methods.py similarity index 100% rename from tests/functional/t/too/too_many_public_methods.py rename to tests/functional/t/too-many-public-methods/too_many_public_methods.py diff --git a/tests/functional/t/too/too_many_public_methods.txt b/tests/functional/t/too-many-public-methods/too_many_public_methods.txt similarity index 100% rename from tests/functional/t/too/too_many_public_methods.txt rename to tests/functional/t/too-many-public-methods/too_many_public_methods.txt diff --git a/tests/functional/t/too/too_many_return_statements.py b/tests/functional/t/too-many-return-statements/too_many_return_statements.py similarity index 100% rename from tests/functional/t/too/too_many_return_statements.py rename to tests/functional/t/too-many-return-statements/too_many_return_statements.py diff --git a/tests/functional/t/too/too_many_return_statements.txt b/tests/functional/t/too-many-return-statements/too_many_return_statements.txt similarity index 100% rename from tests/functional/t/too/too_many_return_statements.txt rename to tests/functional/t/too-many-return-statements/too_many_return_statements.txt diff --git a/tests/functional/t/too/too_many_star_expressions.py b/tests/functional/t/too-many-star-expressions/too_many_star_expressions.py similarity index 100% rename from tests/functional/t/too/too_many_star_expressions.py rename to tests/functional/t/too-many-star-expressions/too_many_star_expressions.py diff --git a/tests/functional/t/too/too_many_star_expressions.txt b/tests/functional/t/too-many-star-expressions/too_many_star_expressions.txt similarity index 100% rename from tests/functional/t/too/too_many_star_expressions.txt rename to tests/functional/t/too-many-star-expressions/too_many_star_expressions.txt diff --git a/tests/functional/t/too/too_many_statements.py b/tests/functional/t/too-many-statements/too_many_statements.py similarity index 100% rename from tests/functional/t/too/too_many_statements.py rename to tests/functional/t/too-many-statements/too_many_statements.py diff --git a/tests/functional/t/too/too_many_statements.rc b/tests/functional/t/too-many-statements/too_many_statements.rc similarity index 100% rename from tests/functional/t/too/too_many_statements.rc rename to tests/functional/t/too-many-statements/too_many_statements.rc diff --git a/tests/functional/t/too/too_many_statements.txt b/tests/functional/t/too-many-statements/too_many_statements.txt similarity index 100% rename from tests/functional/t/too/too_many_statements.txt rename to tests/functional/t/too-many-statements/too_many_statements.txt diff --git a/tests/functional/t/too/__init__.py b/tests/functional/t/too/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/functional/t/too/too_many_ancestors_ignored_parents.rc b/tests/functional/t/too/too_many_ancestors_ignored_parents.rc deleted file mode 100644 index aa652704b7..0000000000 --- a/tests/functional/t/too/too_many_ancestors_ignored_parents.rc +++ /dev/null @@ -1,3 +0,0 @@ -[DESIGN] -max-parents=2 -ignored-parents=functional.t.too.too_many_ancestors_ignored_parents.E diff --git a/tests/functional/u/unhashable_dict_key.py b/tests/functional/u/unhashable-dict-key/unhashable_dict_key.py similarity index 100% rename from tests/functional/u/unhashable_dict_key.py rename to tests/functional/u/unhashable-dict-key/unhashable_dict_key.py diff --git a/tests/functional/u/unhashable_dict_key.txt b/tests/functional/u/unhashable-dict-key/unhashable_dict_key.txt similarity index 100% rename from tests/functional/u/unhashable_dict_key.txt rename to tests/functional/u/unhashable-dict-key/unhashable_dict_key.txt diff --git a/tests/functional/u/unrecognized_inline_option.py b/tests/functional/u/unrecognized-inline-option/unrecognized_inline_option.py similarity index 100% rename from tests/functional/u/unrecognized_inline_option.py rename to tests/functional/u/unrecognized-inline-option/unrecognized_inline_option.py diff --git a/tests/functional/u/unrecognized_inline_option.txt b/tests/functional/u/unrecognized-inline-option/unrecognized_inline_option.txt similarity index 100% rename from tests/functional/u/unrecognized_inline_option.txt rename to tests/functional/u/unrecognized-inline-option/unrecognized_inline_option.txt diff --git a/tests/functional/u/unspecified_encoding_py38.py b/tests/functional/u/unspecified-encoding/unspecified_encoding_py38.py similarity index 100% rename from tests/functional/u/unspecified_encoding_py38.py rename to tests/functional/u/unspecified-encoding/unspecified_encoding_py38.py diff --git a/tests/functional/u/unspecified_encoding_py38.rc b/tests/functional/u/unspecified-encoding/unspecified_encoding_py38.rc similarity index 100% rename from tests/functional/u/unspecified_encoding_py38.rc rename to tests/functional/u/unspecified-encoding/unspecified_encoding_py38.rc diff --git a/tests/functional/u/unspecified_encoding_py38.txt b/tests/functional/u/unspecified-encoding/unspecified_encoding_py38.txt similarity index 100% rename from tests/functional/u/unspecified_encoding_py38.txt rename to tests/functional/u/unspecified-encoding/unspecified_encoding_py38.txt diff --git a/tests/functional/u/unsubscriptable_object.py b/tests/functional/u/unsubscriptable-object/unsubscriptable_object.py similarity index 100% rename from tests/functional/u/unsubscriptable_object.py rename to tests/functional/u/unsubscriptable-object/unsubscriptable_object.py diff --git a/tests/functional/u/unsupported/unsupported_assignment_operation.py b/tests/functional/u/unsupported-assignment-operation/unsupported_assignment_operation.py similarity index 100% rename from tests/functional/u/unsupported/unsupported_assignment_operation.py rename to tests/functional/u/unsupported-assignment-operation/unsupported_assignment_operation.py diff --git a/tests/functional/u/unsupported/unsupported_assignment_operation.rc b/tests/functional/u/unsupported-assignment-operation/unsupported_assignment_operation.rc similarity index 100% rename from tests/functional/u/unsupported/unsupported_assignment_operation.rc rename to tests/functional/u/unsupported-assignment-operation/unsupported_assignment_operation.rc diff --git a/tests/functional/u/unsupported/unsupported_assignment_operation.txt b/tests/functional/u/unsupported-assignment-operation/unsupported_assignment_operation.txt similarity index 100% rename from tests/functional/u/unsupported/unsupported_assignment_operation.txt rename to tests/functional/u/unsupported-assignment-operation/unsupported_assignment_operation.txt diff --git a/tests/functional/u/unsupported/unsupported_binary_operation.py b/tests/functional/u/unsupported-binary-operation/unsupported_binary_operation.py similarity index 100% rename from tests/functional/u/unsupported/unsupported_binary_operation.py rename to tests/functional/u/unsupported-binary-operation/unsupported_binary_operation.py diff --git a/tests/functional/u/unsupported/unsupported_binary_operation.rc b/tests/functional/u/unsupported-binary-operation/unsupported_binary_operation.rc similarity index 100% rename from tests/functional/u/unsupported/unsupported_binary_operation.rc rename to tests/functional/u/unsupported-binary-operation/unsupported_binary_operation.rc diff --git a/tests/functional/u/unsupported/unsupported_binary_operation.txt b/tests/functional/u/unsupported-binary-operation/unsupported_binary_operation.txt similarity index 100% rename from tests/functional/u/unsupported/unsupported_binary_operation.txt rename to tests/functional/u/unsupported-binary-operation/unsupported_binary_operation.txt diff --git a/tests/functional/u/unsupported/unsupported_delete_operation.py b/tests/functional/u/unsupported-delete-operation/unsupported_delete_operation.py similarity index 100% rename from tests/functional/u/unsupported/unsupported_delete_operation.py rename to tests/functional/u/unsupported-delete-operation/unsupported_delete_operation.py diff --git a/tests/functional/u/unsupported/unsupported_delete_operation.rc b/tests/functional/u/unsupported-delete-operation/unsupported_delete_operation.rc similarity index 100% rename from tests/functional/u/unsupported/unsupported_delete_operation.rc rename to tests/functional/u/unsupported-delete-operation/unsupported_delete_operation.rc diff --git a/tests/functional/u/unsupported/unsupported_delete_operation.txt b/tests/functional/u/unsupported-delete-operation/unsupported_delete_operation.txt similarity index 100% rename from tests/functional/u/unsupported/unsupported_delete_operation.txt rename to tests/functional/u/unsupported-delete-operation/unsupported_delete_operation.txt diff --git a/tests/functional/m/member/membership_protocol.py b/tests/functional/u/unsupported-membership-test/membership_protocol.py similarity index 100% rename from tests/functional/m/member/membership_protocol.py rename to tests/functional/u/unsupported-membership-test/membership_protocol.py diff --git a/tests/functional/m/member/membership_protocol.txt b/tests/functional/u/unsupported-membership-test/membership_protocol.txt similarity index 100% rename from tests/functional/m/member/membership_protocol.txt rename to tests/functional/u/unsupported-membership-test/membership_protocol.txt diff --git a/tests/functional/m/member/membership_protocol_py3.py b/tests/functional/u/unsupported-membership-test/membership_protocol_py3.py similarity index 100% rename from tests/functional/m/member/membership_protocol_py3.py rename to tests/functional/u/unsupported-membership-test/membership_protocol_py3.py diff --git a/tests/functional/m/member/membership_protocol_py3.txt b/tests/functional/u/unsupported-membership-test/membership_protocol_py3.txt similarity index 100% rename from tests/functional/m/member/membership_protocol_py3.txt rename to tests/functional/u/unsupported-membership-test/membership_protocol_py3.txt diff --git a/tests/functional/u/useless/useless_suppression.py b/tests/functional/u/useless-suppression/useless_suppression.py similarity index 100% rename from tests/functional/u/useless/useless_suppression.py rename to tests/functional/u/useless-suppression/useless_suppression.py diff --git a/tests/functional/y/yield_inside_async_function.py b/tests/functional/y/yield-inside-async-function/yield_inside_async_function.py similarity index 100% rename from tests/functional/y/yield_inside_async_function.py rename to tests/functional/y/yield-inside-async-function/yield_inside_async_function.py diff --git a/tests/functional/y/yield_inside_async_function.txt b/tests/functional/y/yield-inside-async-function/yield_inside_async_function.txt similarity index 100% rename from tests/functional/y/yield_inside_async_function.txt rename to tests/functional/y/yield-inside-async-function/yield_inside_async_function.txt From 0983aba155d6d2b93e6042eed2ff9cd2f46bd17e Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 28 Nov 2021 15:39:37 +0100 Subject: [PATCH 2/3] [functional test] Add a normalizer for functional directory Filter the message we want to normalize. --- .../functional/functional_test_normalizer.py | 30 +++++++++ tests/test_functional.py | 65 +++++++++++++++++-- 2 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 pylint/testutils/functional/functional_test_normalizer.py diff --git a/pylint/testutils/functional/functional_test_normalizer.py b/pylint/testutils/functional/functional_test_normalizer.py new file mode 100644 index 0000000000..6cee2c4040 --- /dev/null +++ b/pylint/testutils/functional/functional_test_normalizer.py @@ -0,0 +1,30 @@ +from pathlib import Path +from typing import List, Union + +from pylint.message import MessageDefinition, MessageDefinitionStore + + +class FunctionalTestNormalizer: + + """Help normalize the functional tests based on the content of the MessageStore.""" + + def __init__( + self, + base_functional_directory: Union[Path, str], + msg_store: MessageDefinitionStore, + ): + self.base_functional_directory = Path(base_functional_directory) + self.message_store = msg_store + + def __iter__(self): + yield from self.message_store.messages + + def expected_directories(self, message: MessageDefinition) -> List[Path]: + """The normalized directory that should contain the functional test for a message""" + return [ + self.base_functional_directory / message.symbol[0] / d + for d in ( + message.symbol, + message.symbol.replace("-", "_"), + ) + ] diff --git a/tests/test_functional.py b/tests/test_functional.py index eb923401d8..64ebe27bbb 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -31,18 +31,18 @@ from _pytest.recwarn import WarningsRecorder from pylint import testutils +from pylint.lint import PyLinter from pylint.testutils import UPDATE_FILE, UPDATE_OPTION from pylint.testutils.functional import ( FunctionalTestFile, - LintModuleOutputUpdate, get_functional_test_files_from_directory, ) +from pylint.testutils.functional.functional_test_normalizer import ( + FunctionalTestNormalizer, +) +from pylint.testutils.functional.lint_module_output_update import LintModuleOutputUpdate from pylint.utils import HAS_ISORT_5 -# TODOs -# - implement exhaustivity tests - - FUNCTIONAL_DIR = Path(__file__).parent.resolve() / "functional" @@ -57,6 +57,61 @@ "future_unicode_literals", "anomalous_unicode_escape_py3", ] +NO_TESTS_LIST = { + "bad-configuration-section", + "bad-plugin-value", + "fatal", + "astroid-error", + "parse-error", + "config-parse-error", + "raw-checker-failed", + "file-ignored", +} +NORMALIZE_LATER_MAYBE = { + "too-many-format-args", + "too-few-format-args", + "logging-unsupported-format", + "logging-format-truncated", + "suppressed-message", + "locally-disabled", + "no-value-for-parameter", + "too-many-function-args", + "bad-string-format-type", + "unexpected-keyword-arg", + "assignment-from-none", + "unsubscriptable-object", + "bad-str-strip-call", + "c-extension-no-member", + "bad-format-string-key", + "unused-format-string-key", + "bad-format-string", + "missing-format-argument-key", + "unused-format-string-argument", + "format-combined-specification", + "missing-format-attribute", + "invalid-format-index", + "truncated-format-string", + "format-needs-mapping", + "not-an-iterable", + "boolean-datetime", + "deprecated-argument", # move unittest + "duplicate-string-formatting-argument", + "format-string-without-interpolation", +} + + +def test_functional_check_existing(linter: PyLinter): + normalizer = FunctionalTestNormalizer(FUNCTIONAL_DIR, linter.msgs_store) + SKIP = NO_TESTS_LIST + SKIP |= NORMALIZE_LATER_MAYBE + for message in normalizer: + if message.symbol in SKIP: + continue + msg = f"One of '{{}}' should exists to test '{message.symbol}'." + expected_directories = normalizer.expected_directories(message) + assert any(d.exists() for d in expected_directories), msg.format( + expected_directories + ) @pytest.mark.parametrize("test_file", TESTS, ids=TESTS_NAMES) From 6581ed24e824dbbb29d4bba295be98f3d0961eca Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 5 Dec 2021 17:12:26 +0100 Subject: [PATCH 3/3] Add possibility to use checker directory --- .../functional/functional_test_normalizer.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pylint/testutils/functional/functional_test_normalizer.py b/pylint/testutils/functional/functional_test_normalizer.py index 6cee2c4040..3d79cc373a 100644 --- a/pylint/testutils/functional/functional_test_normalizer.py +++ b/pylint/testutils/functional/functional_test_normalizer.py @@ -21,10 +21,12 @@ def __iter__(self): def expected_directories(self, message: MessageDefinition) -> List[Path]: """The normalized directory that should contain the functional test for a message""" - return [ - self.base_functional_directory / message.symbol[0] / d - for d in ( - message.symbol, - message.symbol.replace("-", "_"), - ) - ] + result = [] + intermediate_dirs = (message.checker_name, message.symbol[0]) + leaf_dirs = (message.symbol, message.symbol.replace("-", "_")) + for intermediate_dir in intermediate_dirs: + for leaf_dir in leaf_dirs: + result.append( + self.base_functional_directory / intermediate_dir / leaf_dir + ) + return result