This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients ezio.melotti, michael.foord, rbcollins, terry.reedy
Date 2013-07-05.08:21:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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:33ezio.melottisetrecipients: + ezio.melotti, terry.reedy, rbcollins, michael.foord
2013-07-05 08:21:33ezio.melottisetmessageid: <>
2013-07-05 08:21:33ezio.melottilinkissue18232 messages
2013-07-05 08:21:32ezio.melotticreate