[TIP] alphabetical order in testing
alfredodeza at gmail.com
Tue Jan 19 12:26:26 PST 2010
I am aware that test methods are executed in alphabetical order.
What would be the ideal/preferable way of dealing with methods that depend
in the order they are being executed?
> def test_second_file(self):
> """I depend on z_file"""
> def test_z_file(self):
> """I should run before second_file"""
Would it be OK to alter the naming in the methods to make sure they are run
in the order I need to? Even if the naming gets really weird like:
Or is there a different/better way to do this? I am thinking something like
breaking the above example in 2 different classes and creating the setUp()
and tearDown() methods for each, but wouldn't that be a little redundant?
Thanks again for the help!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python