nose-devs/nose — Issue #285: Support py.test's setup_method that takes method as argument
Author: jpellerin
Created: 2011-12-14 16:06:26+00:00
State: open

py.test supports setup_method and teardown_method functions that take the
method to be called as an argument. (See
http://codespeak.net/py/dist/test.html#id17)

The advantage of this is that you can have slightly different setup and
tear down for different methods within the same class. For a simple
example, I like using different test table names for different database
tests - this means I can simply include the method name within the table
name. (Likewise for filenames. It helps in debugging tests if something
gets left behind that should have been cleaned up)

The other advantage is that this enables the same test suite to be run
under both py.test and nosetests

I've attached a patch that implements this and includes a test.

Google Code Info:
Issue #: 210
Author: dav...@sjsoft.com
Created On: 2008-10-09T08:37:03.000Z
Closed On: