0

A lot of my tests actually do a bunch of mini tests. The logic kinda looks something like:

tests = [("input", "output"), ("input2", "output2")]
for input, output in tests:
    # do test stuff...

This works well for the most part. However, when one of the mini tests fails, it's tedious to fix because none of the mini tests after it get run.

How can I get the "mini tests" to behave like separate tests?

I'm using python3's built in unittest module. I've tried using TestSuite as described here but it doesn't appear to work.

Carson McManus
  • 314
  • 5
  • 10
  • The simplest answer is to convert the "mini tests" into actual tests, i.e. put each one in a separate test method. Is there a reason you don't want to do that? – John Gordon Apr 24 '19 at 16:59
  • Converting each mini test into actual tests would take considerable effort, and adding new tests would also take more time. It's more convenient to just add a test case to a list. – Carson McManus Apr 24 '19 at 17:16

0 Answers0