Kesandal
Kesandal

Reputation: 1303

Implementing tearDownClass functionality in Python 2.6

I've implemented a "global" setUp() for multiple tests inside my class.

Now I would like to know how to make a "global" teardown() function which will be run after the last test has finished, similar to tearDownClass() in Python > 2.7

If the information helps: I'm using nosetests.

Upvotes: 1

Views: 265

Answers (1)

Tom Offermann
Tom Offermann

Reputation: 1421

How about using unittest2?

unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.7.

...

New features include:

  • class and module level fixtures: setUpClass, tearDownClass, setUpModule, tearDownModule

Upvotes: 1

Related Questions