Merge pull request #4529 from aparamon/jxmlunit-call-time
Add --junittime=call option
This commit is contained in:
@@ -153,6 +153,24 @@ class TestPython(object):
|
||||
val = tnode["time"]
|
||||
assert round(float(val), 2) >= 0.03
|
||||
|
||||
def test_call_time(self, testdir):
|
||||
testdir.makepyfile(
|
||||
"""
|
||||
import time, pytest
|
||||
def setup_module():
|
||||
time.sleep(0.1)
|
||||
def teardown_module():
|
||||
time.sleep(0.1)
|
||||
def test_sleep():
|
||||
time.sleep(0.1)
|
||||
"""
|
||||
)
|
||||
result, dom = runandparse(testdir, "-o", "junit_time=call")
|
||||
node = dom.find_first_by_tag("testsuite")
|
||||
tnode = node.find_first_by_tag("testcase")
|
||||
val = tnode["time"]
|
||||
assert 0.1 <= round(float(val), 2) < 0.2
|
||||
|
||||
def test_setup_error(self, testdir):
|
||||
testdir.makepyfile(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user