views:

26

answers:

1

After running a buildout operation on my project, I can run nose with the following command:

# ./bin/nosetests

----------------------------------------------------------------------
Ran 0 tests in 0.310s

However, when I try to pass options (such as -w for the base directory, I get the following:

# ./bin/nosetests -vv --detailed-errors --exe
Usage: nosetests [options]

nosetests: error: no such option: -v

I've checked the test files which are being ran, and removed all lines importing either getopt or OptionParser to ensure they're not getting in the way, but I'm still getting the same error regardless.

I believe one of the files we're testing requires getopt to function... is there any way I can get nosetests to work with buildout without these errors?

+1  A: 

You can use noserunner buildout recipe

Here is example buildout.cfg:

[buildout]
parts = test
index = http://download.zope.org/simple

[test]
recipe = pbp.recipe.noserunner
eggs = pbp.recipe.noserunner
working-directory = ${buildout:directory}

This will create script test in bin directory. Runner will run all tests found in path set in working-directory

Dominik Szopa