This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 187719

Summary: NB can't run tests in packages
Product: python Reporter: ravx
Component: TestingAssignee: Jenselme
Status: NEW ---    
Severity: normal CC: Jenselme
Priority: P2 Keywords: TEST
Version: 6.x   
Hardware: PC   
OS: All   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=255406
Issue Type: DEFECT Exception Reporter:

Description ravx 2010-06-17 11:17:39 UTC
In a situation where we have packages in a project, you can not run the tests.
For example, if we have a structure:

<Top Level>:
        |
        +-Main:
        |   |-__init__.py
        |   |-file1.py
        |
       +-Test:
            |-__init__.py
            |-file1_test.py (Test Unit)

When I try to run the tests in the module file1_test.py get an error from nb_test_runner.py (line 216):
"""
0 tests, 0 failures, 0 errors
    module = __import__ (module_name, globals (), locals (), module_name)
ImportError: No module named file1_test.py
"""
When you move to file1_test.py <Top Level> everything is in OK - tests runs. What's more - no problem running the modules in packages, such as main.file1.py
Comment 1 Lou Dasaro 2015-09-06 05:46:54 UTC
Reassigning to Julien for evaluation.
Comment 2 Jenselme 2015-09-29 14:12:34 UTC
Just tested: it seems that in order to be detected (skeaking for setuptools projects), the tests must be in the main module (eg aot and aot/tests). They are however run by ant even if the user is asked about a main script to execute.

That will require some work after the 8.1 release.