nose-devs/nose — Issue #246: Tests run in non-package directories that contain __init__.py files
Author: jpellerin
Created: 2011-12-14 16:05:10+00:00
State: closed

What steps will reproduce the problem?
1. $ mkdir not-a-package
2. $ echo 'def testme(): pass' >> not-a-package/testme.py
3. $ nosetests

----------------------------------------------------------------------
Ran 0 tests in 0.002s

OK
4. $ touch not-a-package/__init__.py
5. $ nosetests -v
not-a-package.testme.testme ... ok

----------------------------------------------------------------------
Ran 1 test in 0.013s

OK

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

Expected output of final step above is:

$ nosetests

----------------------------------------------------------------------
Ran 0 tests in 0.002s

OK

The test function testme() should not be run, because its module is not
part of a Python package (since "not-a-package" is not a valid Python
package name).

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

http://python-nose.googlecode.com/svn/branches/0.10.0-stable revision 408,
Ubuntu gutsy.

Please provide any additional information below.

This bug is not terribly important, but it's annoying when you want to hide
a package from nose by renaming it, and the fix is fairly obvious
(nose.selector.wantDirectory needs to know about valid Python module names).

Google Code Info:
Issue #: 143
Author: j...@pobox.com
Created On: 2007-12-16T01:09:02.000Z
Closed On: 2007-12-17T15:30:08.000Z