[Tutor] Questions as to how to run the same unit test multiple times on varying input data.

boB Stepp robertvstepp at gmail.com
Sat Sep 24 02:30:39 EDT 2016


I wanted to add a clarification as to what I was hoping to achieve.

On Sat, Sep 24, 2016 at 12:55 AM, boB Stepp <robertvstepp at gmail.com> wrote:
>
> Of course, this code passed its test when the string was "Monty
> Python", so I next wanted to run the same test with different strings
> each time, so that my code would fail in these more general cases.
> However, I struggled to find a way to repeat the same test with
> varying data, eventually crying "Uncle!" and consulted the
> documentation.

What I struggled with was getting tests to run for ALL of the data.
Until I found subTest in the docs, the tests would stop with the FIRST
failure, whereas I wanted to see ALL failures and passes.  That is, I
wanted to exercise all of the data inputs and see the collected
results.

boB


More information about the Tutor mailing list