turn some tests from skipped to xfail

strike dead code, small refinements to xfail exception reporting

--HG--
branch : 1.0.x
This commit is contained in:
holger krekel
2009-08-09 23:46:27 +02:00
parent d41949a6e3
commit 5c8df1d4ca
6 changed files with 22 additions and 11 deletions
+4 -2
View File
@@ -19,8 +19,6 @@ when it fails. Instead terminal reporting will list it in the
import py
pytest_plugins = ['keyword']
def pytest_runtest_makereport(__call__, item, call):
if call.when != "call":
return
@@ -53,6 +51,9 @@ def pytest_terminal_summary(terminalreporter):
modpath = rep.item.getmodpath(includemodule=True)
pos = "%s %s:%d: " %(modpath, entry.path, entry.lineno)
reason = rep.longrepr.reprcrash.message
i = reason.find("\n")
if i != -1:
reason = reason[:i]
tr._tw.line("%s %s" %(pos, reason))
xpassed = terminalreporter.stats.get("xpassed")
@@ -89,3 +90,4 @@ def test_xfail(testdir):
"*test_that*",
])
assert result.ret == 1
-3
View File
@@ -200,9 +200,6 @@ class PluginManager(object):
config.hook.pytest_unconfigure(config=config)
config.pluginmanager.unregister(self)
class Ext:
""" namespace for extension objects. """
#
# XXX old code to automatically load classes
#
+10 -1
View File
@@ -185,7 +185,7 @@ class TestPytestPluginInteractions:
assert hello == "world"
""")
result = testdir.runpytest(p)
assert result.stdout.fnmatch_lines([
result.stdout.fnmatch_lines([
"*1 passed*"
])
@@ -247,3 +247,12 @@ def test_collectattr():
assert list(methods) == ['pytest_hello', 'pytest_world']
methods = py.builtin.sorted(collectattr(B()))
assert list(methods) == ['pytest_hello', 'pytest_world']
@py.test.mark.xfail
def test_namespace_has_default_and_env_plugins(testdir):
p = testdir.makepyfile("""
import py
py.test.mark
""")
result = testdir.runpython(p)
assert result.ret == 0