Python Nose Import Error

后端 未结 9 569
谎友^
谎友^ 2020-11-28 22:28

I can\'t seem to get the nose testing framework to recognize modules beneath my test script in the file structure. I\'ve set up the simplest example that demonstrates the p

9条回答
  •  失恋的感觉
    2020-11-28 22:37

    For example, with the following directory structure, if you want to run nosetests in m1, m2 or m3 to test some functions in n.py, you should use from m2.m3 import n in test.py.

    m1
    └── m2
        ├── __init__.py
        └── m3
            ├── __init__.py
            ├── n.py
            └── test
                └── test.py
    

提交回复
热议问题