Fixes Issue 1549

This commit is contained in:
John Towler 2016-05-04 13:36:27 -07:00
parent 60212e8831
commit 0d07b64571
3 changed files with 6 additions and 5 deletions

View File

@ -49,6 +49,7 @@ Jaap Broekhuizen
Jan Balster Jan Balster
Janne Vanhala Janne Vanhala
Jason R. Coombs Jason R. Coombs
John Towler
Joshua Bronson Joshua Bronson
Jurko Gospodnetić Jurko Gospodnetić
Katarzyna Jachim Katarzyna Jachim

View File

@ -369,7 +369,7 @@ class LogXML(object):
suite_stop_time = time.time() suite_stop_time = time.time()
suite_time_delta = suite_stop_time - self.suite_start_time suite_time_delta = suite_stop_time - self.suite_start_time
numtests = self.stats['passed'] + self.stats['failure'] numtests = self.stats['passed'] + self.stats['failure'] + self.stats['skipped']
logfile.write('<?xml version="1.0" encoding="utf-8"?>') logfile.write('<?xml version="1.0" encoding="utf-8"?>')
logfile.write(Junit.testsuite( logfile.write(Junit.testsuite(

View File

@ -100,7 +100,7 @@ class TestPython:
result, dom = runandparse(testdir) result, dom = runandparse(testdir)
assert result.ret assert result.ret
node = dom.find_first_by_tag("testsuite") node = dom.find_first_by_tag("testsuite")
node.assert_attr(name="pytest", errors=0, failures=1, skips=3, tests=2) node.assert_attr(name="pytest", errors=0, failures=1, skips=3, tests=5)
def test_timing_function(self, testdir): def test_timing_function(self, testdir):
testdir.makepyfile(""" testdir.makepyfile("""
@ -304,7 +304,7 @@ class TestPython:
result, dom = runandparse(testdir) result, dom = runandparse(testdir)
assert not result.ret assert not result.ret
node = dom.find_first_by_tag("testsuite") node = dom.find_first_by_tag("testsuite")
node.assert_attr(skips=1, tests=0) node.assert_attr(skips=1, tests=1)
tnode = node.find_first_by_tag("testcase") tnode = node.find_first_by_tag("testcase")
tnode.assert_attr( tnode.assert_attr(
file="test_xfailure_function.py", file="test_xfailure_function.py",
@ -325,7 +325,7 @@ class TestPython:
result, dom = runandparse(testdir) result, dom = runandparse(testdir)
# assert result.ret # assert result.ret
node = dom.find_first_by_tag("testsuite") node = dom.find_first_by_tag("testsuite")
node.assert_attr(skips=1, tests=0) node.assert_attr(skips=1, tests=1)
tnode = node.find_first_by_tag("testcase") tnode = node.find_first_by_tag("testcase")
tnode.assert_attr( tnode.assert_attr(
file="test_xfailure_xpass.py", file="test_xfailure_xpass.py",
@ -356,7 +356,7 @@ class TestPython:
result, dom = runandparse(testdir) result, dom = runandparse(testdir)
assert result.ret == EXIT_NOTESTSCOLLECTED assert result.ret == EXIT_NOTESTSCOLLECTED
node = dom.find_first_by_tag("testsuite") node = dom.find_first_by_tag("testsuite")
node.assert_attr(skips=1, tests=0) node.assert_attr(skips=1, tests=1)
tnode = node.find_first_by_tag("testcase") tnode = node.find_first_by_tag("testcase")
tnode.assert_attr( tnode.assert_attr(
file="test_collect_skipped.py", file="test_collect_skipped.py",