How to parameterize unittests

Serhiy Storchaka storchaka at gmail.com
Fri Apr 15 04:31:07 EDT 2016


On 15.04.16 11:20, Antoon Pardon wrote:
> But the tests, at this moment, are not written to instantiate self.tree
> but to call avltree directly. So I have to rewrite these tests. That
> will IMO involve a lot of cut and paste.

There is yet one approach. Import your original test file, patch it by 
setting it's global avltree to your subclass, run tests. Don't forget to 
restore original values. This approach is more fragile and less 
flexible, but doesn't need modifying the original test.





More information about the Python-list mailing list