SetUp functions for multiple test cases

Georg Schmid gspschmid at gmail.com
Tue Jan 20 09:33:29 EST 2009


I've just started working with unittests and already hit a snag. I
couldn't find out how to implement a setup function, that is executed
only _once_ before all of the tests. Specifically, I need this for
testing my database interface, and naturally I don't want to create a
new database in-memory and fill it with example data for every single
test case.
Obviously I could simply execute that setup function separately from
the unittesting procedure, but then there'd be no point in
implementing all my unittests in a clean manner in the first place,
apart from further problems arising due to how my IDE (Eric4) picks
test cases from project files.
Perhaps I missed something about the concept of TestSuites. Thanks in
advance!



More information about the Python-list mailing list