Include setup and teardown in junitxml test durations

--HG--
branch : include-setup-teardown-duration-in-junitxml
This commit is contained in:
Janne Vanhala
2015-05-01 14:55:52 +03:00
parent aa2ffb9805
commit 93628fc0eb
2 changed files with 9 additions and 5 deletions

View File

@@ -44,6 +44,10 @@ class TestPython:
def test_timing_function(self, testdir):
testdir.makepyfile("""
import time, pytest
def setup_module():
time.sleep(0.01)
def teardown_module():
time.sleep(0.01)
def test_sleep():
time.sleep(0.01)
""")
@@ -51,7 +55,7 @@ class TestPython:
node = dom.getElementsByTagName("testsuite")[0]
tnode = node.getElementsByTagName("testcase")[0]
val = tnode.getAttributeNode("time").value
assert float(val) >= 0.001
assert float(val) >= 0.03
def test_setup_error(self, testdir):
testdir.makepyfile("""