bobber6467 / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

allow setup to pass info to teardown #334

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Would be nice to have the ability to have setup pass something to teardown.

When using a class, this is typically done with class attributes:

    class test_stuff:
        def setUp(self):
            self.remember = 'something'
        def tearDown(self):
            if self.remember == 'something': ...

But when using decorators (@with_setup) and such, this isn't available.

This is especially useful when the test run needs a temporary directory to 
run in and setup creates that directory; passing the directory name to 
teardown would be useful.

Original issue reported on code.google.com by kq1qu...@gmail.com on 15 Apr 2010 at 4:48