nose-devs/nose — Issue #314: nose.run(...) not finding folder specified by --where
Author: jpellerin
Created: 2011-12-14 16:07:22+00:00
State: open

What steps will reproduce the problem?
1. create a python script (myscript.py) containing the statement:
success = nose.run(argv=['', '--where="ABC"' % source, '--verbosity=2'])
2. create a sub-folder named ABC in the folder containing myscript.py.
3. run the script with no command-line arguments
prompt> myscript.py

What is the expected output?

..........
----------------------------------------------------------------------
Ran 10 tests in 0.359s

OK

What do you see instead?

Traceback (most recent call last):
File "C:\Documents and Settings\jim.vickroy\My
Documents\Projects\+INSTALLERS\INSTALLER-BUILDER.py", line 300, in
tests_passed = test (target) if options.test else True
File "", line 2, in test
File "C:\Documents and Settings\jim.vickroy\My
Documents\Projects\+INSTALLERS\INSTALLER-BUILDER.py", line 104, in trace
return f(*args, **kw)
File "C:\Documents and Settings\jim.vickroy\My
Documents\Projects\+INSTALLERS\INSTALLER-BUILDER.py", line 273, in test
success = runner.run(argv=['', '--where="%s"' % source, '--verbosity=2'])
File "c:\python25\lib\site-packages\nose-0.10.4-py2.5.egg\nose\core.py",
line 368, in run
return TestProgram(*arg, **kw).success
File "c:\python25\lib\site-packages\nose-0.10.4-py2.5.egg\nose\core.py",
line 219, in __init__
argv=argv, testRunner=testRunner, testLoader=testLoader)
File "C:\Python25\lib\unittest.py", line 767, in __init__
self.parseArgs(argv)
File "c:\python25\lib\site-packages\nose-0.10.4-py2.5.egg\nose\core.py",
line 236, in parseArgs
self.config.configure(argv, doc=TestProgram.__doc__)
File
"c:\python25\lib\site-packages\nose-0.10.4-py2.5.egg\nose\config.py", line
279, in configure
self.configureWhere(options.where)
File
"c:\python25\lib\site-packages\nose-0.10.4-py2.5.egg\nose\config.py", line
356, in configureWhere
"not a directory" % path)
ValueError: Working directory "ABC" not found, or not a directory

What version of the product are you using? On what operating system?

nose: 0.10.4
python: 2.5.4
OS: MS Windows XP Pro with svc pk 3

Please provide any additional information below.

From the folder containing myscript.py, the following command works as
expected:

prompt> nosetests --where="RTGM" -v

Also, myscript.py contains the following (successful) assertion immediately
prior to the nose.run(...) call:
assert os.path.exists('ABC')

Finally, the --verbosity=2 argument seems to be ignored when used in
myscript.py but works as expected when using nosetests on a command-line.

Google Code Info:
Issue #: 225
Author: jim.vick...@noaa.gov
Created On: 2009-01-08T18:17:00.000Z
Closed On: