nose-devs/nose — Issue #345: Nose cannot run from within an egg archive.
Author: jpellerin
Created: 2011-12-14 16:08:43+00:00
State: closed

What steps will reproduce the problem?
1. python setup.py bdist_egg
2. install the egg on sys.path and run unittests

What is the expected output? What do you see instead?

I expected the tests to run. Instead::

[exec] Traceback (most recent call last):
[exec] File "[/path/to]/python/tests/testrunner.py", line 40, in
[exec] sys.exit(main())
[exec] File "[/path/to]/python/tests/testrunner.py", line 36, in main
[exec] return nose.main(argv=argv)
[exec] File "build/bdist.macosx-10.5-i386/egg/nose/core.py", line 113, in __init__
[exec] File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/unittest.py", line 767, in __init__
[exec] self.parseArgs(argv)
[exec] File "build/bdist.macosx-10.5-i386/egg/nose/core.py", line 130, in parseArgs
[exec] File "build/bdist.macosx-10.5-i386/egg/nose/core.py", line 234, in usage
[exec] IOError: [Errno 20] Not a directory: '[/path/to]/third_party/lib/python/nose-0.11.1-py2.5.egg/nose/usage.txt'

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

Happens on both mac and linux, python2.5, nose 0.11.1

Please provide any additional information below.

The default TestProgram.usage() expects the contents to be in a directory on the filesystem. Our deployment process creates egg
archives for all dependencies so it's important we are able to run from an egg. I'm attaching a patch (against 11.1) which will attempt to
use the package's loader to get the data, failing that it will use the file system.

Google Code Info:
Issue #: 288
Author: bzimmer%...@gtempaccount.com
Created On: 2009-08-27T03:36:17.000Z
Closed On: 2009-09-27T14:58:53.000Z