The nose cannot do this by default, as far as I know. Here are a few options:
1. Fake it from the command line
Probably not what you are looking for, but I should have mentioned it. You can also create a wrapper script to simplify this:
python -c 'import testFile; testFile.check_even(2, 6)'
2. Create your own nose test loader
This is a little more, but you can create your own test loader, which interprets the command line arguments by asking the generator to load, pull the tests and arguments from the generator, and return a set containing the test with the corresponding arguments.
Below is an example of code that should give you enough room to create ( runner.py ):
import ast import nose class CustomLoader(nose.loader.TestLoader): def loadTestsFromName(self, name, module=None):
Performance:
% python runner.py 'testFile.test_evens(2, 6)' -v testFile.check_even(2, 6) ... ok % python runner.py 'testFile.test_evens(2, 6)' 'testFile.test_evens(4, 12)' -v testFile.check_even(2, 6) ... ok testFile.check_even(4, 12) ... ok % python runner.py 'testFile.test_evens(1, 3)' -v testFile.check_even(1, 3) ... FAIL
source share