def setup():
    global foo
foo = 10

def teardown():
    global foo
foo = None

@with_setup(setup, teardown)
def test_foo_value():
    assert_equal(foo, 10)
How can I access variables set in the python nosetests setup function