Skip to content
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

Fix tests with Python 3.9 #586

Merged
merged 1 commit into from
Oct 3, 2020
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
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ matrix:
dist: xenial
- python: 3.8
dist: xenial
- python: nightly
dist: xenial
# TODO: https://bugs.python.org/issue40334
# the PEG parser is currently broken in some cases
allow_failures:
- python: nightly
- python: 3.9-dev
dist: xenial
Copy link
Member

Choose a reason for hiding this comment

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

oh oops now that I look at this, this is 3.10a0 -- should we select 3.9 here explicitly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've set it to 3.9-dev. It seems to be the best way at the moment.

install: pip install tox
script: tox -e py
8 changes: 6 additions & 2 deletions pyflakes/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,6 @@ def evaluate(source):
with self.makeTempFile(source) as sourcePath:
if PYPY:
message = 'end of file (EOF) while scanning triple-quoted string literal'
elif sys.version_info >= (3, 9):
message = 'invalid string prefix'
else:
message = 'invalid syntax'

Expand Down Expand Up @@ -517,6 +515,8 @@ def foo(bar=baz, bax):
if ERROR_HAS_LAST_LINE:
if PYPY:
column = 7
elif sys.version_info >= (3, 9):
column = 21
elif sys.version_info >= (3, 8):
column = 9
else:
Expand Down Expand Up @@ -545,6 +545,8 @@ def test_nonKeywordAfterKeywordSyntaxError(self):
if ERROR_HAS_LAST_LINE:
if PYPY:
column = 12
elif sys.version_info >= (3, 9):
column = 17
elif sys.version_info >= (3, 8):
column = 14
else:
Expand Down Expand Up @@ -579,6 +581,8 @@ def test_invalidEscape(self):
position_end = 1
if PYPY:
column = 5
elif ver >= (3, 9):
column = 13
else:
column = 7
# Column has been "fixed" since 3.2.4 and 3.3.1
Expand Down