The nose
discovery process finds all modules whose name starts with test
, and within them all functions which have test
in the name and tries to run them as unit tests. See http://nose.readthedocs.org/en/latest/man.html
I have a function whose name is say, make_test_account
, in the file accounts.py
. I want to test that function in a test module called test_account
. So at the start of that file I do:
from foo.accounts import make_test_account
But now I find that nose treats the function make_test_account
as a unit test and tries to run it (which fails because it doesn't pass in any parameters, which are required).
How can I make sure nose ignores that function specifically? I would prefer to do it in a way which means I can invoke nose as nosetests
, without any command line arguments.