Message192331
> I'm thinking I'll add a '--min-tests=X' parameter to unittest.main,
> with the semantic that if there are less than X tests executed, the
> test run will be considered a failure,
The minimum number of tests is a fast moving target, and unless you know exactly how many tests you have and use that value, missing tests will be undetected. If you only want to distinguish between 0 and more tests, a boolean flag is enough, but checking that at least 1 test in the whole test suite is run is quite pointless IMHO (I assume it's quite easy to notice if/when it happens).
Making this per-module or even per-class would be more interesting (because it's harder to spot these problems), but OTOH there's no way to know for sure if this is what the user wants. A good compromise might be using a boolean flag that generates a warning by using some heuristic (e.g. test discovery found a test_*.py file that defines no tests, or a TestCase class that defines no test_* methods and has no subclasses (or have no subclasses with test_* methods)). |
|
Date |
User |
Action |
Args |
2013-07-05 08:21:33 | ezio.melotti | set | recipients:
+ ezio.melotti, terry.reedy, rbcollins, michael.foord |
2013-07-05 08:21:33 | ezio.melotti | set | messageid: <1373012493.07.0.0405480415216.issue18232@psf.upfronthosting.co.za> |
2013-07-05 08:21:33 | ezio.melotti | link | issue18232 messages |
2013-07-05 08:21:32 | ezio.melotti | create | |
|