Chipopo
Chipopo

Reputation: 57

How to make nosetests use nosetests-2.7.exe

I'm trying to start nosetests in programmatic way from my script

import nose nose.main()

or

import nose result = nose.run()

and it doesn't recognize my tests , when I use :

import subprocess subprocess.call('c:\somePath\nosetests-2.7.exe -w C:\MyProject -v -s ')

it works , my question is can I config somewhere nose.run() or nose.main() to use nosetests-2.7.exe

Upvotes: 0

Views: 196

Answers (2)

Oleksiy
Oleksiy

Reputation: 6567

The first argument to the argv is always the process itself. So try something like:

   import sys
   import nose

   nose.run(argv=[sys.argv[0], 'C:\MyProject', '-s', '-v'])

Upvotes: 0

Vaibhav Sagar
Vaibhav Sagar

Reputation: 2266

Are you sure the issue is with the wrong nosetests binary? What happens if you try

nose.run(argv="-w C:\MyProject -v -s".split())

and what error are you currently getting?

Upvotes: 0

Related Questions