Skip to content

Clean up tests that had min_pyver=3.8 test setting #8811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions doc/whatsnew/2/2.15/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,6 @@ Release date: 2022-09-07
- Fix false positive for ``too-many-function-args`` when a function call is assigned to a class attribute inside the class where the function is defined.

Closes #6592 (`#6592 <https://github.com/pylint-dev/pylint/issues/6592>`_)
- Fix ``used-before-assignment`` for functions/classes defined in type checking guard.

Closes #7368 (`#7368 <https://github.com/pylint-dev/pylint/issues/7368>`_)
Comment on lines -386 to -388
Copy link
Member Author

@jacobtylerwalls jacobtylerwalls Jul 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other cleanup 1: this was given twice, see above under 2.15.2.

- Fix ignored files being linted when passed on stdin.

Closes #4354 (`#4354 <https://github.com/pylint-dev/pylint/issues/4354>`_)
Expand Down
2 changes: 1 addition & 1 deletion doc/whatsnew/2/2.17/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ False Positives Fixed
Other Bug Fixes
---------------

- Improve output of ``consider-using-generator`` message for ``min()` calls
- Improve output of ``consider-using-generator`` message for ``min()`` calls
with ``default`` keyword.

Closes #8563 (`#8563 <https://github.com/PyCQA/pylint/issues/8563>`_)
Expand Down
2 changes: 1 addition & 1 deletion doc/whatsnew/fragments/8563.bugfix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Improve output of ``consider-using-generator`` message for ``min()` calls with ``default`` keyword.
Improve output of ``consider-using-generator`` message for ``min()`` calls with ``default`` keyword.

Closes #8563
10 changes: 3 additions & 7 deletions pylint/checkers/refactoring/refactoring_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,16 +1133,12 @@ def _check_super_with_arguments(self, node: nodes.Call) -> None:
if not isinstance(node.func, nodes.Name) or node.func.name != "super":
return

# pylint: disable=too-many-boolean-expressions
if (
len(node.args) != 2
or not isinstance(node.args[1], nodes.Name)
or not all(isinstance(arg, nodes.Name) for arg in node.args)
or node.args[1].name != "self"
or not isinstance(node.args[0], nodes.Name)
or not isinstance(node.args[1], nodes.Name)
or node_frame_class(node) is None
# TODO: PY38: Use walrus operator, this will also fix the mypy issue
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other cleanup 2: resolve this TODO

or node.args[0].name != node_frame_class(node).name # type: ignore[union-attr]
or (frame_class := node_frame_class(node)) is None
or node.args[0].name != frame_class.name
):
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
py-version=3.8

[testoptions]
min_pyver=3.8
max_pyver=3.10
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[main]
py-version=3.8

[testoptions]
min_pyver=3.8
2 changes: 0 additions & 2 deletions tests/functional/a/assignment/assignment_expression.rc

This file was deleted.

3 changes: 0 additions & 3 deletions tests/functional/a/attribute_defined_outside_init_py38.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[main]
load-plugins=pylint.extensions.typing

[testoptions]
min_pyver=3.8
2 changes: 0 additions & 2 deletions tests/functional/b/bad_reversed_sequence_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/c/cached_property.rc

This file was deleted.

1 change: 0 additions & 1 deletion tests/functional/d/deprecated/deprecated_methods_py38.rc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[testoptions]
min_pyver=3.8
max_pyver=3.9
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
[MAIN]
load-plugins=pylint.extensions.consider_refactoring_into_while_condition,
[testoptions]
min_pyver=3.8
3 changes: 0 additions & 3 deletions tests/functional/ext/docparams/docparams_py38.rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ accept-no-param-doc = no
accept-no-raise-doc = no
accept-no-return-doc = no
accept-no-yields-doc = no

[testoptions]
min_pyver=3.8
3 changes: 0 additions & 3 deletions tests/functional/ext/docparams/missing_param_doc_py38.rc
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[MASTER]
load-plugins=pylint.extensions.docparams,

[testoptions]
min_pyver=3.8

[PARAMETER_DOCUMENTATION]
accept-no-param-doc=no
accept-no-raise-doc=no
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/ext/no_self_use/no_self_use.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[main]
load-plugins=pylint.extensions.no_self_use

[testoptions]
min_pyver=3.8
3 changes: 0 additions & 3 deletions tests/functional/ext/typing/typing_consider_using_alias.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
py-version=3.8
load-plugins=pylint.extensions.typing

[testoptions]
min_pyver=3.8

[typing]
runtime-typing=no
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
py-version=3.8
load-plugins=pylint.extensions.typing

[testoptions]
min_pyver=3.8

[typing]
runtime-typing=no
3 changes: 0 additions & 3 deletions tests/functional/ext/typing/typing_consider_using_union.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
py-version=3.8
load-plugins=pylint.extensions.typing

[testoptions]
min_pyver=3.8

[typing]
runtime-typing=no
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
py-version=3.8
load-plugins=pylint.extensions.typing

[testoptions]
min_pyver=3.8

[typing]
runtime-typing=no

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/n/name/name_final.rc

This file was deleted.

3 changes: 0 additions & 3 deletions tests/functional/n/name/name_final_snake_case.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[testoptions]
min_pyver=3.8

[BASIC]
class-const-naming-style=snake_case
const-naming-style=snake_case
2 changes: 0 additions & 2 deletions tests/functional/n/named_expr_without_context_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/n/no/no_method_argument_py38.rc

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[testoptions]
min_pyver=3.8
max_pyver=3.9
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[testoptions]
min_pyver=3.8
max_pyver=3.9

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/n/none_dunder_protocols_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/o/overridden_final_method_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/p/positional_only_arguments_expected.rc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[testoptions]
min_pyver=3.8
max_pyver=3.9
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[testoptions]
min_pyver=3.8
max_pyver=3.9
2 changes: 0 additions & 2 deletions tests/functional/p/protocol_classes.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/p/protocol_classes_abstract.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/r/redundant_u_string_prefix.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/r/regression/regression_posonly_args.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/r/regression_02/regression_4660.rc

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/s/subclassed_final_class_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/s/super/super_init_not_called_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/s/superfluous_parens_walrus_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/t/typedDict.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/u/undefined/undefined_loop_variable_py38.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/u/undefined/undefined_variable_py38.rc

This file was deleted.

4 changes: 0 additions & 4 deletions tests/functional/u/undefined/undefined_variable_typing.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
[testoptions]
# This was added as PyPy is only able to run this on 3.8 and above
min_pyver=3.8

[VARIABLES]
additional-builtins=__additional_builtin__
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@
DICT = {1: lambda x: x, 2: lambda x: x + 1}
for key, value in DICT.items():
print(value(key))

# Flag lambda expression assignments via named expressions as well.
if (e := lambda: 2) and e(): # [unnecessary-lambda-assignment]
pass
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ unnecessary-lambda-assignment:22:4:22:15:<lambda>:"Lambda expression assigned to
unnecessary-lambda-assignment:23:4:23:15:<lambda>:"Lambda expression assigned to a variable. Define a function using the ""def"" keyword instead.":HIGH
unnecessary-lambda-assignment:26:10:26:21:<lambda>:"Lambda expression assigned to a variable. Define a function using the ""def"" keyword instead.":HIGH
unnecessary-lambda-assignment:26:23:26:34:<lambda>:"Lambda expression assigned to a variable. Define a function using the ""def"" keyword instead.":HIGH
unnecessary-lambda-assignment:37:9:37:18:<lambda>:"Lambda expression assigned to a variable. Define a function using the ""def"" keyword instead.":HIGH

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,7 @@ def _get_extra_attrs(self, extra_columns):
nums = list(range(20))
for y, x in enumerate(nums, start=Y_START + 1):
pass

for idx, val in enumerate(my_list):
if (val := 42) and my_list[idx] == 'b':
print(1)

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/u/unspecified_encoding_py38.rc

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/functional/u/unused/unused_typing_imports.rc

This file was deleted.

3 changes: 0 additions & 3 deletions tests/functional/u/unused/unused_variable_py38.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[testoptions]
min_pyver=3.8

[variables]
allow-global-unused-variables=no

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/u/used/used_before_assignment_ternary.rc

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/u/useless/useless_parent_delegation_py38.rc

This file was deleted.