Skip to content

Commit

Permalink
Update functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Apr 23, 2023
1 parent c0d961b commit dc5c7b8
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 27 deletions.
4 changes: 2 additions & 2 deletions tests/functional/b/bad_reversed_sequence_py37.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/b/bad_reversed_sequence_py37.rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[testoptions]
max_pyver=3.8
[main]
py-version=3.7
1 change: 0 additions & 1 deletion tests/functional/b/bad_reversed_sequence_py37.txt
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[testoptions]
max_pyver=3.8
[main]
py-version=3.7
14 changes: 13 additions & 1 deletion tests/functional/s/star/star_needs_assignment_target.py
Original file line number Diff line number Diff line change
@@ -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,]
2 changes: 1 addition & 1 deletion tests/functional/s/star/star_needs_assignment_target.txt
Original file line number Diff line number Diff line change
@@ -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
15 changes: 0 additions & 15 deletions tests/functional/s/star/star_needs_assignment_target_py37.py

This file was deleted.

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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
syntax-error:7:37:None:None::"Parsing failed: 'cannot use starred expression here (<unknown>, line 7)'":HIGH

0 comments on commit dc5c7b8

Please sign in to comment.