-
Notifications
You must be signed in to change notification settings - Fork 140
Closed
Description
I'm trying to use xmlrunner in conjunction with subtests. In general it works, but if all subtests pass the XML output says tests="1", although I'm having more subtests than 1. On the other hand the XML output says tests="2" if 2 subtests fail, although there is still only one testcase. Is this the expected behaviour or am I doing anything wrong?
A minimum test code to reproduce could look like:
import unittest
class ut_test(unittest.TestCase):
values = [True, False, True, False]
def test_True(self):
for i, val in enumerate(ut_test.values):
with self.subTest(i=i):
self.assertTrue(val)
if __name__ == "__main__":
import xmlrunner
with open("unittest.xml", 'wb') as output:
unittest.main(
testRunner=xmlrunner.XMLTestRunner(output=output),
failfast=False, buffer=False, catchbreak=False, exit=False)
Metadata
Metadata
Assignees
Labels
No labels