On Fri, Jul 9, 2010 at 5:24 AM, Alexander Belopolsky <alexander.belopol...@gmail.com> wrote: > Yes, this is definitely an improvement over my current datetime patch > [1]_, but it still requires a custom test_main() and does not make the > test cases discoverable by alternative unittest runners. I think that > can be fixed by injecting imported TestCase subclasses into the main > test module globals.
So include something along the lines of "globals()[obj.__name__] = obj" in the name hacking loop to make the test classes more discoverable? Good idea. Including a comment in the main test module along the lines of your reply to Antoine would be good, too (i.e. this is acknowledged as being something of a hack to make sure we don't break the datetime tests when updating them to be applied to both the existing C module and the new pure Python equivalent). As Antoine says, using explicit subclasses is a *much* cleaner way of doing this kind of thing when the tests are being written from scratch to test multiple implementations within a single interpreter. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com