diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 966ef192d..a1b308760 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -12,9 +12,6 @@ from _pytest._code.code import ( ReprExceptionInfo, ExceptionChainRepr) -queue = py.builtin._tryimport('queue', 'Queue') - -failsonjython = pytest.mark.xfail("sys.platform.startswith('java')") from test_source import astonly try: @@ -24,7 +21,10 @@ except ImportError: else: invalidate_import_caches = getattr(importlib, "invalidate_caches", None) -import pytest +queue = py.builtin._tryimport('queue', 'Queue') + +failsonjython = pytest.mark.xfail("sys.platform.startswith('java')") + pytest_version_info = tuple(map(int, pytest.__version__.split(".")[:3])) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 72bc9aec2..2d61b7440 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1,24 +1,24 @@ from __future__ import absolute_import, division, print_function + import glob import os import py_compile import stat import sys import zipfile - import py import pytest -ast = pytest.importorskip("ast") -if sys.platform.startswith("java"): - # XXX should be xfail - pytest.skip("assert rewrite does currently not work on jython") - import _pytest._code from _pytest.assertion import util from _pytest.assertion.rewrite import rewrite_asserts, PYTEST_TAG, AssertionRewritingHook from _pytest.main import EXIT_NOTESTSCOLLECTED +ast = pytest.importorskip("ast") +if sys.platform.startswith("java"): + # XXX should be xfail + pytest.skip("assert rewrite does currently not work on jython") + def setup_module(mod): mod._old_reprcompare = util._reprcompare diff --git a/tox.ini b/tox.ini index 9312432b2..438910f43 100644 --- a/tox.ini +++ b/tox.ini @@ -196,6 +196,6 @@ filterwarnings = ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning [flake8] -ignore = E402,E501,E701,E702,E704,E712,E731 +ignore = E501,E701,E702,E704,E712,E731 max-line-length = 120 exclude = _pytest/vendored_packages/pluggy.py