fix issue47 - fix time-per-test timing output for junitxml

This commit is contained in:
holger krekel
2011-05-28 14:03:10 +02:00
parent 70d22fbe9a
commit 8dc4e732f0
5 changed files with 17 additions and 5 deletions

View File

@@ -39,6 +39,18 @@ class TestPython:
node = dom.getElementsByTagName("testsuite")[0]
assert_attr(node, errors=0, failures=1, skips=3, tests=2)
def test_timing_function(self, testdir):
testdir.makepyfile("""
import time, pytest
def test_sleep():
time.sleep(0.01)
""")
result, dom = runandparse(testdir)
node = dom.getElementsByTagName("testsuite")[0]
tnode = node.getElementsByTagName("testcase")[0]
val = tnode.getAttributeNode("time").value
assert float(val) >= 0.01
def test_setup_error(self, testdir):
testdir.makepyfile("""
def pytest_funcarg__arg(request):