fix issue75 - test failure on jython.

also experimentally enable more tests in the jython test env.
This commit is contained in:
holger krekel 2011-09-25 07:40:43 +02:00
parent be249dcfe5
commit 3bd3ba133f
4 changed files with 9 additions and 2 deletions

View File

@ -2,6 +2,7 @@ Changes between 2.1.2 and [next version]
---------------------------------------- ----------------------------------------
- fix issue67 / junitxml now contains correct test durations, thanks ronny - fix issue67 / junitxml now contains correct test durations, thanks ronny
- fix issue75 / skipping test failure on jython
Changes between 2.1.1 and 2.1.2 Changes between 2.1.1 and 2.1.2
---------------------------------------- ----------------------------------------

View File

@ -25,6 +25,7 @@ def pytest_configure(config):
_pytest_fullpath _pytest_fullpath
except NameError: except NameError:
_pytest_fullpath = os.path.abspath(pytest.__file__.rstrip("oc")) _pytest_fullpath = os.path.abspath(pytest.__file__.rstrip("oc"))
_pytest_fullpath = _pytest_fullpath.replace("$py.class", ".py")
def pytest_funcarg___pytest(request): def pytest_funcarg___pytest(request):
return PytestArg(request) return PytestArg(request)

View File

@ -1,4 +1,5 @@
import pytest import pytest
import sys
from _pytest.skipping import MarkEvaluator, folded_skips from _pytest.skipping import MarkEvaluator, folded_skips
from _pytest.skipping import pytest_runtest_setup from _pytest.skipping import pytest_runtest_setup
@ -486,6 +487,10 @@ def test_errors_in_xfail_skip_expressions(testdir):
pass pass
""") """)
result = testdir.runpytest() result = testdir.runpytest()
markline = " ^"
if sys.platform.startswith("java"):
# XXX report this to java
markline = "*" + markline[8:]
result.stdout.fnmatch_lines([ result.stdout.fnmatch_lines([
"*ERROR*test_nameerror*", "*ERROR*test_nameerror*",
"*evaluating*skipif*expression*", "*evaluating*skipif*expression*",
@ -493,7 +498,7 @@ def test_errors_in_xfail_skip_expressions(testdir):
"*ERROR*test_syntax*", "*ERROR*test_syntax*",
"*evaluating*xfail*expression*", "*evaluating*xfail*expression*",
" syntax error", " syntax error",
" ^", markline,
"SyntaxError: invalid syntax", "SyntaxError: invalid syntax",
"*1 pass*2 error*", "*1 pass*2 error*",
]) ])

View File

@ -66,7 +66,7 @@ deps=py>=1.4.0
[testenv:jython] [testenv:jython]
changedir=testing changedir=testing
commands= commands=
{envpython} {envbindir}/py.test-jython --no-tools-on-path \ {envpython} {envbindir}/py.test-jython \
-rfsxX --junitxml={envlogdir}/junit-{envname}2.xml [] -rfsxX --junitxml={envlogdir}/junit-{envname}2.xml []
[pytest] [pytest]