Message 140999 - Python tracker

Message140999

Author michael.foord
Recipients Yaroslav.Halchenko, abingham, brian.curtin, eric.araujo, eric.snow, exarkun, ezio.melotti, fperez, michael.foord, nchauvat, ncoghlan, pitrou, r.david.murray, terry.reedy
Date 2011-07-23.18:09:59
SpamBayes Score 0.00045452025
Marked as misclassified No
Message-id <1311444600.74.0.197958818172.issue12600@psf.upfronthosting.co.za>
In-reply-to
Content
Having a "TestCase factory" would be pretty easy, and solve the scaling problems.

For example:

def make_testcase_classes():
    for backend in backends:
        yield type(
            '{}Test'.format(backend.name),
            (TheBaseClass, unittest.TestCase),
            {'backend': backend}
        )

You would use this in the load_tests function at the module level to generate all the test cases.
History
Date User Action Args
2011-07-23 18:10:00michael.foordsetrecipients: + michael.foord, terry.reedy, exarkun, ncoghlan, pitrou, ezio.melotti, eric.araujo, r.david.murray, brian.curtin, fperez, Yaroslav.Halchenko, nchauvat, abingham, eric.snow
2011-07-23 18:10:00michael.foordsetmessageid: <1311444600.74.0.197958818172.issue12600@psf.upfronthosting.co.za>
2011-07-23 18:10:00michael.foordlinkissue12600 messages
2011-07-23 18:10:00michael.foordcreate