Skip to content

Merge in test cases from 3.8 #51

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ def test_parser_modes(self):
for mode in ['exec', 'single', 'eval']:
self.check_roundtrip(code_parseable_in_all_parser_modes, mode=mode)

@unittest.skipUnless(sys.version_info >= (3, 6), "Only for Python 3.6 or greater")
def test_fstrings(self):
self.check_roundtrip(r"""f'{f"{0}"*3}'""")
self.check_roundtrip(r"""f'{f"{y}"*3}'""")

def test_strings(self):
self.check_roundtrip("u'foo'")
self.check_roundtrip("r'foo'")
self.check_roundtrip("b'foo'")

def test_del_statement(self):
self.check_roundtrip("del x, y, z")

Expand Down Expand Up @@ -409,6 +419,11 @@ def test_with_as(self):
def test_with_two_items(self):
self.check_roundtrip(with_two_items)

@unittest.skipUnless(sys.version_info >= (3, 5), "Only for Python 3.5 or greater")
def test_dict_unpacking_in_dict(self):
self.check_roundtrip(r"""{**{'y': 2}, 'x': 1}""")
self.check_roundtrip(r"""{**{'y': 2}, **{'x': 1}}""")

@unittest.skipIf(sys.version_info < (3, 5), "Not supported < 3.5")
def test_async_function_def(self):
self.check_roundtrip(async_function_def)
Expand Down