Question

I have a project for which I have traditionally run my unit tests with a make file like

NOSE_CMD=nosetests --config setup.cfg

test:
    $(NOSE_CMD) 

test-fast:
    $(NOSE_CMD) -A "not slow and not valuations"

test-slow:
    $(NOSE_CMD) -A "slow or valuations"

and a setup.cfg like this

[nosetests]
all-modules=1
with-doctest=1
verbosity=3
processes=3
process-timeout=600
exe=1

Now I'm trying to run this all from a Python script. My first attempt to mimic the behavior of 'make test-fast' from above was

argv = ['-A "not slow and not valuations"']
nose.run(argv=argv)

This doesn't work, though. It's running all of my tests, regardless of attributes. Is this because I need to activate the attributes plug-in manually somehow?

Much thanks for any help.

Was it helpful?

Solution

Try:

argv = ['-A', 'not slow and not valuations']
nose.main(argv=argv)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top