diff --git a/tests/functional/b/bad_reversed_sequence_py37.py b/tests/functional/b/bad_reversed_sequence_py37.py index 5a0b2124c2d..4f132d945e5 100644 --- a/tests/functional/b/bad_reversed_sequence_py37.py +++ b/tests/functional/b/bad_reversed_sequence_py37.py @@ -1,8 +1,8 @@ """ Dictionaries are reversible starting on python 3.8""" - # pylint: disable=missing-docstring -reversed({'a': 1, 'b': 2}) # [bad-reversed-sequence] +# This can't be detected since changes to locals aren't backported +reversed({'a': 1, 'b': 2}) class InheritDict(dict): diff --git a/tests/functional/b/bad_reversed_sequence_py37.rc b/tests/functional/b/bad_reversed_sequence_py37.rc index 67a28a36aa5..77eb3be6456 100644 --- a/tests/functional/b/bad_reversed_sequence_py37.rc +++ b/tests/functional/b/bad_reversed_sequence_py37.rc @@ -1,2 +1,2 @@ -[testoptions] -max_pyver=3.8 +[main] +py-version=3.7 diff --git a/tests/functional/b/bad_reversed_sequence_py37.txt b/tests/functional/b/bad_reversed_sequence_py37.txt index 6fbbd2c591f..da511347b70 100644 --- a/tests/functional/b/bad_reversed_sequence_py37.txt +++ b/tests/functional/b/bad_reversed_sequence_py37.txt @@ -1,2 +1 @@ -bad-reversed-sequence:5:0:5:26::The first reversed() argument is not a sequence:UNDEFINED bad-reversed-sequence:12:0:12:39::The first reversed() argument is not a sequence:UNDEFINED diff --git a/tests/functional/s/singledispatch/singledispatch_method_py37.rc b/tests/functional/s/singledispatch/singledispatch_method_py37.rc index 67a28a36aa5..77eb3be6456 100644 --- a/tests/functional/s/singledispatch/singledispatch_method_py37.rc +++ b/tests/functional/s/singledispatch/singledispatch_method_py37.rc @@ -1,2 +1,2 @@ -[testoptions] -max_pyver=3.8 +[main] +py-version=3.7 diff --git a/tests/functional/s/star/star_needs_assignment_target.py b/tests/functional/s/star/star_needs_assignment_target.py index 5421c226b7b..c9dbf17448f 100644 --- a/tests/functional/s/star/star_needs_assignment_target.py +++ b/tests/functional/s/star/star_needs_assignment_target.py @@ -1,4 +1,16 @@ -"""Test for a = *b""" +""" +Test PEP 0448 -- Additional Unpacking Generalizations +https://www.python.org/dev/peps/pep-0448/ +""" +# pylint: disable=superfluous-parens, unnecessary-comprehension + +UNPACK_TUPLE = (*range(4), 4) +UNPACK_LIST = [*range(4), 4] +UNPACK_SET = {*range(4), 4} +UNPACK_DICT = {'a': 1, **{'b': '2'}} +UNPACK_DICT2 = {**UNPACK_DICT, "x": 1, "y": 2} +UNPACK_DICT3 = {**{'a': 1}, 'a': 2, **{'a': 3}} + FIRST = *[1, 2] # [star-needs-assignment-target] *THIRD, FOURTH = [1, 2, 3,] diff --git a/tests/functional/s/star/star_needs_assignment_target.txt b/tests/functional/s/star/star_needs_assignment_target.txt index 318acad61bb..ec3a9f30a0f 100644 --- a/tests/functional/s/star/star_needs_assignment_target.txt +++ b/tests/functional/s/star/star_needs_assignment_target.txt @@ -1 +1 @@ -star-needs-assignment-target:3:8:3:15::Can use starred expression only in assignment target:UNDEFINED +star-needs-assignment-target:15:8:15:15::Can use starred expression only in assignment target:UNDEFINED diff --git a/tests/functional/s/star/star_needs_assignment_target_py37.py b/tests/functional/s/star/star_needs_assignment_target_py37.py deleted file mode 100644 index fb5eea86a74..00000000000 --- a/tests/functional/s/star/star_needs_assignment_target_py37.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -Test PEP 0448 -- Additional Unpacking Generalizations -https://www.python.org/dev/peps/pep-0448/ -""" - -# pylint: disable=superfluous-parens, unnecessary-comprehension - -UNPACK_TUPLE = (*range(4), 4) -UNPACK_LIST = [*range(4), 4] -UNPACK_SET = {*range(4), 4} -UNPACK_DICT = {'a': 1, **{'b': '2'}} -UNPACK_DICT2 = {**UNPACK_DICT, "x": 1, "y": 2} -UNPACK_DICT3 = {**{'a': 1}, 'a': 2, **{'a': 3}} - -UNPACK_IN_COMP = {elem for elem in (*range(10))} # [star-needs-assignment-target] diff --git a/tests/functional/s/star/star_needs_assignment_target_py37.rc b/tests/functional/s/star/star_needs_assignment_target_py37.rc deleted file mode 100644 index 67a28a36aa5..00000000000 --- a/tests/functional/s/star/star_needs_assignment_target_py37.rc +++ /dev/null @@ -1,2 +0,0 @@ -[testoptions] -max_pyver=3.8 diff --git a/tests/functional/s/star/star_needs_assignment_target_py37.txt b/tests/functional/s/star/star_needs_assignment_target_py37.txt deleted file mode 100644 index fb5a5faa6b5..00000000000 --- a/tests/functional/s/star/star_needs_assignment_target_py37.txt +++ /dev/null @@ -1 +0,0 @@ -star-needs-assignment-target:15:36:15:46::Can use starred expression only in assignment target:UNDEFINED diff --git a/tests/functional/s/star/star_needs_assignment_target_syntax.py b/tests/functional/s/star/star_needs_assignment_target_syntax.py new file mode 100644 index 00000000000..bde687a523d --- /dev/null +++ b/tests/functional/s/star/star_needs_assignment_target_syntax.py @@ -0,0 +1,7 @@ +""" +Test PEP 0448 -- Additional Unpacking Generalizations +https://www.python.org/dev/peps/pep-0448/ +""" +# pylint: disable=superfluous-parens, unnecessary-comprehension + +UNPACK_IN_COMP = {elem for elem in (*range(10))} # [syntax-error] diff --git a/tests/functional/s/star/star_needs_assignment_target_syntax.txt b/tests/functional/s/star/star_needs_assignment_target_syntax.txt new file mode 100644 index 00000000000..2c7e1e79ac0 --- /dev/null +++ b/tests/functional/s/star/star_needs_assignment_target_syntax.txt @@ -0,0 +1 @@ +syntax-error:7:37:None:None::"Parsing failed: 'cannot use starred expression here (, line 7)'":HIGH