The problem I'm seeing, is that I created a test that generated 6 subtests and they were all failing, but the output from zope.testrunner was rather unhelpful:
Running zope.testrunner.layer.UnitTests tests:
Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
Ran 1 tests with 3 failures, 0 errors and 0 skipped in 0.001 seconds.
Tearing down left over layers:
Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
It correctly reports the 3 failures, but shows no traceback at all ๐
What I did:
Create a test like:
class DummyExampleTest(unittest.TestCase):
def test_example(self):
data = (
(2, 3, 5),
(2, 3, 6),
(2, 3, 7),
(2, 3, 8),
)
for first, second, result in data:
with self.subTest(result):
self.assertEqual(first + second, result)
Run it with zope.testrunner -t DummyExampleTest and see the output above.
What I expect to happen:
That the 3 failures would show their traceback.
What actually happened:
No tracebacks to be seen.
What version of Python and Zope/Addons I am using:
BUG/PROBLEM REPORT / FEATURE REQUEST
The other day I learned about
unittest.subTest
, see docs.Which is, partly the same as pytest.mark.parametrize.
The problem I'm seeing, is that I created a test that generated 6 subtests and they were all failing, but the output from
zope.testrunner
was rather unhelpful:It correctly reports the 3 failures, but shows no traceback at all ๐
What I did:
Create a test like:
Run it with
zope.testrunner -t DummyExampleTest
and see the output above.What I expect to happen:
That the 3 failures would show their traceback.
What actually happened:
No tracebacks to be seen.
What version of Python and Zope/Addons I am using:
Fedora Linux 40 Python 3.11 zope.testrunner 6.4 Zope 5.9 Plone 6.0.10