I have a situation where for some of the tests, I require to use different setup method than I have defined for all, And for this I though to use @with_setup decorator of nose.
However this doesn't seem to be working.
code:
import unittest
from nose.tools.nontrivial import with_setup
__author__ = 'gaurang_shah1'
class Demo(unittest.TestCase):
def setup_func(self):
print "setup_func"
def teardown_func(self):
print "teardown function"
def setUp(self):
print "setup"
@with_setup(setup_func, teardown_func)
def test_setup(self):
print "test setup"
I am expecting following output,
setup_func
test setup
teardown_func
However I am getting following output, is there anything wrong I am doing here.
setup
test setup