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

Python 3.8 test failures: ast.Constant #139

Closed
hroncok opened this issue May 3, 2019 · 3 comments
Closed

Python 3.8 test failures: ast.Constant #139

hroncok opened this issue May 3, 2019 · 3 comments
Assignees

Comments

@hroncok
Copy link
Contributor

hroncok commented May 3, 2019

$ tox -e py38-pytest41
GLOB sdist-make: .../pytest-testmon/setup.py
py38-pytest41 inst-nodeps: .../pytest-testmon/.tox/.tmp/package/1/pytest-testmon-0.9.15.zip
py38-pytest41 installed: atomicwrites==1.3.0,attrs==19.1.0,coverage==4.5.3,coverage-pth==0.0.2,more-itertools==7.0.0,pluggy==0.9.0,py==1.8.0,pytest==4.1.1,pytest-testmon==0.9.15,six==1.12.0
py38-pytest41 run-test-pre: PYTHONHASHSEED='2120733739'
py38-pytest41 runtests: commands[0] | py.test --tb=native test
============================= test session starts ==============================
platform linux -- Python 3.8.0a3, pytest-4.1.1, py-1.8.0, pluggy-0.9.0
cachedir: .tox/py38-pytest41/.pytest_cache
rootdir: .../pytest-testmon, inifile: pytest.ini
plugins: testmon-0.9.15
collected 100 items

test/test_core.py ...........................                            [ 27%]
test/test_process_code.py ......F........................                [ 58%]
test/test_subprocess.py .x.x                                             [ 62%]
test/test_testmon.py .............................x.......s              [100%]

=================================== FAILURES ===================================
______________________ TestReadSrc.test_module_with_1250 _______________________
Traceback (most recent call last):
  File ".../pytest-testmon/test/test_process_code.py", line 53, in test_module_with_1250
    assert "Str('\\xc5\\xa1')" in code_repr or "Str('š')" in Module(None, 'test/samples/print1250r.py').blocks[
AssertionError: assert ("Str('\\xc5\\xa1')" in "0:Expr(Call(Name('print', Load()), Constant('š', None), ))" or "Str('š')" in "0:Expr(Call(Name('print', Load()), Constant('š', None), ))")
 +  where "0:Expr(Call(Name('print', Load()), Constant('š', None), ))" = 2-2 h: 877007445, n:unknown, repr:0:Expr(Call(Name('print', Load()), Constant('š', None), )).code
========== 1 failed, 95 passed, 1 skipped, 3 xfailed in 7.49 seconds ===========
.../pytest-testmon/.tox/py38-pytest41/lib/python3.8/site-packages/testmon/process_code.py:9: SyntaxWarning: invalid escape sequence \s
  coding_re = re.compile(b'coding[=:]\s*([-\w.]+)')
ERROR: InvocationError for command '.../pytest-testmon/.tox/py38-pytest41/bin/py.test --tb=native test' (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py38-pytest41: commands failed

This is caused by python/cpython#9445

Class ast.Constant is now used for all constants. Old classes ast.Num, ast.Str, ast.Bytes, ast.NameConstant and ast.Ellipsis are still available, but they will be removed in future Python releases.

@hroncok hroncok changed the title Python 3.8 failures: ast.Constant Python 3.8 test failures: ast.Constant May 3, 2019
@Matlino
Copy link
Contributor

Matlino commented May 15, 2019

I am not able to reproduce the error. I ran the same command but it was successful. Could you verify the error? On which commit you get this error?

@Matlino Matlino self-assigned this May 15, 2019
@hroncok
Copy link
Contributor Author

hroncok commented May 15, 2019

bcd89a6

@hroncok
Copy link
Contributor Author

hroncok commented May 15, 2019

3b68557

$ tox -e py38-pytest41
GLOB sdist-make: .../pytest-testmon/setup.py
py38-pytest41 inst-nodeps: .../pytest-testmon/.tox/.tmp/package/1/pytest-testmon-0.9.16.zip
py38-pytest41 installed: atomicwrites==1.3.0,attrs==19.1.0,coverage==4.5.3,coverage-pth==0.0.2,more-itertools==7.0.0,pluggy==0.11.0,py==1.8.0,pytest==4.1.1,pytest-testmon==0.9.16,six==1.12.0
py38-pytest41 run-test-pre: PYTHONHASHSEED='3286914867'
py38-pytest41 runtests: commands[0] | py.test --tb=native test
============================= test session starts ==============================
platform linux -- Python 3.8.0a4, pytest-4.1.1, py-1.8.0, pluggy-0.11.0
cachedir: .tox/py38-pytest41/.pytest_cache
rootdir: .../pytest-testmon, inifile: pytest.ini
plugins: testmon-0.9.16
collected 101 items

test/test_core.py ...........................                            [ 26%]
test/test_process_code.py ......F........................                [ 57%]
test/test_subprocess.py .x.x                                             [ 61%]
test/test_testmon.py .............................x.......xs             [100%]

=================================== FAILURES ===================================
______________________ TestReadSrc.test_module_with_1250 _______________________
Traceback (most recent call last):
  File ".../pytest-testmon/test/test_process_code.py", line 53, in test_module_with_1250
    assert "Str('\\xc5\\xa1')" in code_repr or "Str('š')" in Module(None, 'test/samples/print1250r.py').blocks[
AssertionError: assert ("Str('\\xc5\\xa1')" in "0:Expr(Call(Name('print', Load()), Constant('š', None), ))" or "Str('š')" in "0:Expr(Call(Name('print', Load()), Constant('š', None), ))")
 +  where "0:Expr(Call(Name('print', Load()), Constant('š', None), ))" = 2-2 h: 877007445, n:unknown, repr:0:Expr(Call(Name('print', Load()), Constant('š', None), )).code
=============================== warnings summary ===============================
.tox/py38-pytest41/lib/python3.8/site-packages/pluggy/hooks.py:130
  .../pytest-testmon/.tox/py38-pytest41/lib/python3.8/site-packages/pluggy/hooks.py:130: DeprecationWarning: Use inspect.signature() instead of inspect.getfullargspec()
    return inspect.getfullargspec(func)
  ...

-- Docs: https://docs.pytest.org/en/latest/warnings.html
==== 1 failed, 95 passed, 1 skipped, 4 xfailed, 71 warnings in 7.44 seconds ====
.../pytest-testmon/.tox/py38-pytest41/lib/python3.8/site-packages/testmon/process_code.py:9: SyntaxWarning: invalid escape sequence \s
  coding_re = re.compile(b'coding[=:]\s*([-\w.]+)')
ERROR: InvocationError for command '.../pytest-testmon/.tox/py38-pytest41/bin/py.test --tb=native test' (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py38-pytest41: commands failed

@tarpas tarpas closed this as completed in 4c47a28 May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants