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 chris.jerdonek
Recipients chris.jerdonek
Date 2012-06-22.08:25:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340353530.68.0.240528814016.issue15132@psf.upfronthosting.co.za>
In-reply-to
Content
It would be nice if unittest.TestProgram(), aka unittest.main(), allowed one to set self.testNames by programmatically passing in a list of test names.

Currently, unittest.main() almost allows this: the constructor sets self.testNames to a 1-tuple containing the value of the defaultTest argument.  But defaultTest can only be a string, not a list of test names.

A way around this is to pass the test names explicitly via the argv argument, but this seems less elegant as a programmatic API.  Moreover, this approach isn't equivalent because test names passed via argv first get passed to a _convert_names() function.

It seems like it would be a natural and simple change to enhance unittest.TestProgram() to accept not just a name but also a list of names for the defaultTest argument.  Thanks.
History
Date User Action Args
2012-06-22 08:25:30chris.jerdoneksetrecipients: + chris.jerdonek
2012-06-22 08:25:30chris.jerdoneksetmessageid: <1340353530.68.0.240528814016.issue15132@psf.upfronthosting.co.za>
2012-06-22 08:25:29chris.jerdoneklinkissue15132 messages
2012-06-22 08:25:28chris.jerdonekcreate