mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 05:26:53 +00:00
Fix tests for Python 3.6, 3.7 and pypy
This commit is contained in:
parent
255122c2a6
commit
2523cdfdcd
1 changed files with 11 additions and 2 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
"""Integration tests for the main entrypoint of flake8."""
|
"""Integration tests for the main entrypoint of flake8."""
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
|
import sys
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
@ -183,10 +185,17 @@ def test_tokenization_error_but_not_syntax_error(tmpdir, capsys):
|
||||||
_call_main(['t.py'], retv=1)
|
_call_main(['t.py'], retv=1)
|
||||||
|
|
||||||
out, err = capsys.readouterr()
|
out, err = capsys.readouterr()
|
||||||
assert out == '''\
|
|
||||||
|
expected = '''\
|
||||||
t.py:1:1: E902 TokenError: EOF in multi-line statement
|
t.py:1:1: E902 TokenError: EOF in multi-line statement
|
||||||
t.py:1:8: E999 SyntaxError: unexpected EOF while parsing
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
expected += '''\
|
||||||
|
t.py:1:8: E999 SyntaxError: unexpected EOF while parsing
|
||||||
|
''' if (platform.python_implementation() == "CPython"
|
||||||
|
and sys.version_info >= (3, 8)) else ""
|
||||||
|
|
||||||
|
assert out == expected
|
||||||
assert err == ''
|
assert err == ''
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue