Skip to content

_pytest.assertion.pytest_configure() incompatible with Jython 2.5 #65

Closed

Description

@pytestbot

Originally reported by: Arfrever Frehtes Taifersar Arahesis (BitBucket: arfrever, GitHub: arfrever)


ast module is absent in CPython 2.5 and present in Jython 2.5. _pytest.assertion.pytest_configure() with Jython 2.5 uses _pytest.assertion.rewrite.AssertionRewritingHook(), which uses sys.dont_write_bytecode, which is available only in Python >=2.6.

Test results:

============================= test session starts ==============================
platform java1.6.0_26 -- Python 2.5.1 -- pytest-2.1.1
collected 3 items / 33 errors 

doc/example/costlysetup/sub1/test_quick.py .
doc/example/costlysetup/sub2/test_two.py ..

==================================== ERRORS ====================================
___________ ERROR collecting doc/example/assertion/test_failures.py ____________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
______ ERROR collecting doc/example/assertion/test_setup_flow_example.py _______
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
 ERROR collecting doc/example/assertion/global_testmodule_config/test_hello.py _
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
_________________ ERROR collecting testing/acceptance_test.py __________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
_______________ ERROR collecting testing/test_assertinterpret.py _______________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_assertion.py __________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
________________ ERROR collecting testing/test_assertrewrite.py ________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_capture.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
_________________ ERROR collecting testing/test_collection.py __________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_config.py ____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_conftest.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
____________________ ERROR collecting testing/test_core.py _____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_doctest.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_genscript.py __________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
_________________ ERROR collecting testing/test_helpconfig.py __________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_junitxml.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
____________________ ERROR collecting testing/test_mark.py _____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
_________________ ERROR collecting testing/test_monkeypatch.py _________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
____________________ ERROR collecting testing/test_nose.py _____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_parseopt.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_pastebin.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
_____________________ ERROR collecting testing/test_pdb.py _____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_pytester.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_python.py ____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_recwarn.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_resultlog.py __________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_runner.py ____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
________________ ERROR collecting testing/test_runner_xunit.py _________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_session.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_skipping.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_terminal.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
___________________ ERROR collecting testing/test_tmpdir.py ____________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
__________________ ERROR collecting testing/test_unittest.py ___________________
/usr/share/jython-2.5/Lib/site-packages/py/_path/local.py:529: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
build-2.5-jython/lib/_pytest/assertion/rewrite.py:103: in find_module
>       write = not sys.dont_write_bytecode
E       AttributeError: 'systemstate' object has no attribute 'dont_write_bytecode'
===================== 3 passed, 33 error in 14.98 seconds ======================

Activity

  1. pytestbot commented on Sep 25, 2011

    @pytestbot
    ContributorAuthor

    Original comment by Arfrever Frehtes Taifersar Arahesis (BitBucket: arfrever, GitHub: arfrever):


    <<changeset 0dcf96067a0a>>

    <>

  2. pytestbot commented on Sep 25, 2011

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    this should be fixed with 2.1.2 actually

  3. added a commit that references this issue on Oct 27, 2018
    489d00e
  4. added a commit that references this issue on May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions