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 piotr.dobrogost
Recipients chris.jerdonek, ezio.melotti, michael.foord, piotr.dobrogost
Date 2012-10-27.10:50:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351335008.33.0.690961257922.issue16312@psf.upfronthosting.co.za>
In-reply-to
Content
@Chris

The example given by Holger Krekel (http://stackoverflow.com/a/13094042/95735) showing how it can be done with pytest is exactly the thing I had in mind. It would be good to have this feature incorporated into unittest.

@Michael

I guess checking this flag must be protected by a lock in case test cases are run in parallel. If so wouldn't this be kind of a bottleneck? Is this flag necessary? Can't we just assume that initialization code had already run when any testcase runs?

There's interesting question how would initialization code be run in case of auto discovery. In the simplest form it would be run just once before all modules with tests are run. But it would be interesting to allow running initialization per test module. To support this unittest should somehow pass name of test module to be executed to initialization code. Alternatively there could be some special named init files which would be run before running test modules.
History
Date User Action Args
2012-10-27 10:50:08piotr.dobrogostsetrecipients: + piotr.dobrogost, ezio.melotti, michael.foord, chris.jerdonek
2012-10-27 10:50:08piotr.dobrogostsetmessageid: <1351335008.33.0.690961257922.issue16312@psf.upfronthosting.co.za>
2012-10-27 10:50:08piotr.dobrogostlinkissue16312 messages
2012-10-27 10:50:07piotr.dobrogostcreate