try to make test suite pass on jython 2.5.1 again

This commit is contained in:
holger krekel 2011-09-21 08:12:37 +02:00
parent 4316cf2121
commit d37af98db3
4 changed files with 6 additions and 2 deletions

View File

@ -281,6 +281,7 @@ class TestInvocationVariants:
result = testdir.runpython(p) result = testdir.runpython(p)
assert result.ret == 0 assert result.ret == 0
@pytest.mark.xfail("sys.platform.startswith('java')")
def test_pydoc(self, testdir): def test_pydoc(self, testdir):
for name in ('py.test', 'pytest'): for name in ('py.test', 'pytest'):
result = testdir.runpython_c("import %s;help(%s)" % (name, name)) result = testdir.runpython_c("import %s;help(%s)" % (name, name))

View File

@ -235,7 +235,7 @@ def test_traceback_failure(testdir):
"*test_traceback_failure.py:4: AssertionError" "*test_traceback_failure.py:4: AssertionError"
]) ])
@pytest.mark.skipif("sys.version_info < (2,5) or '__pypy__' in sys.builtin_module_names") @pytest.mark.skipif("sys.version_info < (2,5) or '__pypy__' in sys.builtin_module_names or sys.platform.startswith('java')" )
def test_warn_missing(testdir): def test_warn_missing(testdir):
p1 = testdir.makepyfile("") p1 = testdir.makepyfile("")
result = testdir.run(sys.executable, "-OO", "-m", "pytest", "-h") result = testdir.run(sys.executable, "-OO", "-m", "pytest", "-h")

View File

@ -4,6 +4,9 @@ import py
import pytest import pytest
ast = pytest.importorskip("ast") ast = pytest.importorskip("ast")
if sys.platform.startswith("java"):
# XXX should be xfail
pytest.skip("assert rewrite does currently not work on jython")
from _pytest.assertion import util from _pytest.assertion import util
from _pytest.assertion.rewrite import rewrite_asserts from _pytest.assertion.rewrite import rewrite_asserts

View File

@ -89,7 +89,7 @@ class TestConftestValueAccessGlobal:
assert value == 1.5 assert value == 1.5
path = py.path.local(mod.__file__) path = py.path.local(mod.__file__)
assert path.dirpath() == basedir.join("adir", "b") assert path.dirpath() == basedir.join("adir", "b")
assert path.purebasename == "conftest" assert path.purebasename.startswith("conftest")
def test_conftest_in_nonpkg_with_init(tmpdir): def test_conftest_in_nonpkg_with_init(tmpdir):
tmpdir.ensure("adir-1.0/conftest.py").write("a=1 ; Directory = 3") tmpdir.ensure("adir-1.0/conftest.py").write("a=1 ; Directory = 3")