Skip to content

Commit

Permalink
[tests] reproducing #219
Browse files Browse the repository at this point in the history
  • Loading branch information
XonqNopp committed Apr 17, 2020
1 parent e8a337c commit 4488d42
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testsuite.py
Expand Up @@ -192,6 +192,11 @@ def test_subTest_mixed(self):
with self.subTest(i=i):
self.assertLess(i, 1, msg='this is a subtest.')

def test_subTest_with_dots(self):
for i in range(2):
with self.subTest(step='hello.world.{}'.format(i)):
self.fail('this is a subtest.')

class DecoratedUnitTest(unittest.TestCase):

@some_decorator
Expand Down Expand Up @@ -567,6 +572,14 @@ def test_unittest_subTest_pass(self):
suite.addTest(self.DummySubTest('test_subTest_pass'))
self._test_xmlrunner(suite)

@unittest.skipIf(not hasattr(unittest.TestCase, 'subTest'),
'unittest.TestCase.subTest not present.')
def test_unittest_subTest_with_dots(self):
# Test for issue #85
suite = unittest.TestSuite()
suite.addTest(self.DummySubTest('test_subTest_with_dots'))
self._test_xmlrunner(suite)

def test_xmlrunner_pass(self):
suite = unittest.TestSuite()
suite.addTest(self.DummyTest('test_pass'))
Expand Down

0 comments on commit 4488d42

Please sign in to comment.