The nose has a nottest decorator. However, if you do not want to use the @nottest decorator in the module you are importing, you can also simply change the method after importing. It may be cleaner to keep the unit test logic close to the unit test itself.
from foo.accounts import make_test_account
You can still use nottest , but it has the same effect:
from nose.tools import nottest from foo.accounts import make_test_account
jsnow source share