[Pyunit-interest] Automatically generated tests
Brought to you by:
purcell
From: Magnus L. H. <ma...@he...> - 2005-03-14 10:15:20
|
Hi! I've been using the default test loader, writing several tests in the same TestCase (using the method naming convention method). This seems fine for hard-coded tests, but I keep running into the need to auto-generate tests, by trying out various combinations of parameters, for example (i.e., having a few loops in my test method). The problem is that I'd like to run each case (i.e., combination of parameters) with the same fixture. In other words, I'd like to have a separate test (with a separate run of setUp/tearDown) for each case -- but without having to write separate test methods for each of them. I guess I could have separate code for creating individual TestCase objects separately and add them to a common suite etc. -- but using the standard unittest.main() method is quite convenient... :] What is the "best practice" for automatically generated tests in PyUnit? -- Magnus Lie Hetland Time flies like the wind. Fruit flies http://hetland.org like bananas. -- Groucho Marx |