相关疑难解决方法(0)

鼻子无法在ubuntu中找到测试

是否有任何理由为什么Nose无法在Ubuntu 9.04中找到测试?

我正在使用带有python 2.5.4的鼻子0.11.1.
我只有在明确指定文件名时才能运行测试.如果我没有指定它只是说的文件名,0测试.

同样的项目在我的Mac上运行测试很好,所以我很难过!

python nose

52
推荐指数
5
解决办法
2万
查看次数

使用Nose在目录中运行所有测试

我需要能够通过在Linux shell中键入一行来在当前目录中运行所有测试.在某些目录中,这很好用.但在其他情况下,当我输入"nosetests"时,没有进行任何测试.如果我单独调用它们,测试将运行,但我需要它们全部自动运行.这是一个不起作用的目录:

/extwebserver
    __init__.py
    test_Detection.py
    test_Filesystem.py 
    test_Hardware.py
    ...
Run Code Online (Sandbox Code Playgroud)

当我在父目录中运行"nosetests"时,将运行某个子目录中的所有测试,但不会运行/ extwebserver或其他子目录或父目录本身的测试.

编辑 这是输出:

matthew@Matthew-Laptop:~/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing$ nosetests -vv --collect-only
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/baseTestCase.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/run.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/test_Detection.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/test_Filesystem.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/test_Hardware.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/test_Mode.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/test_System.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/test_View.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/extwebserver/test_Webserver.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/mocks/bottle.py is executable; skipped
nose.selector: INFO: /home/matthew/Documents/ParkAssist/m3/linux/appfs/master/usr/bin/piopio/testing/utils/test_timestamps.py is …
Run Code Online (Sandbox Code Playgroud)

python nose

23
推荐指数
2
解决办法
2万
查看次数

我怎么告诉django-nose我的测试在哪里?

我在测试目录中测试了Django应用程序:

my_project/apps/my_app/
??? __init__.py
??? tests
?   ??? __init__.py
?   ??? field_tests.py
?   ??? storage_tests.py
??? urls.py
??? utils.py
??? views.py
Run Code Online (Sandbox Code Playgroud)

Django测试运行器要求我将一个suite()函数放在__init__.py我的应用程序的tests目录的文件中.该函数返回当我执行$ python manage.py test时将运行的测试用例

我安装了django-nose.当我尝试使用django-nose运行测试时,运行0测试:

$ python manage.py test <app_name>
Run Code Online (Sandbox Code Playgroud)

如果我直接指向测试模块,则运行测试:

$ python manage.py test my_project.apps.my_app.tests.storage_tests
Run Code Online (Sandbox Code Playgroud)

为什么django-nose的测试跑者没有找到我的测试?我必须做什么?

python django unit-testing nose django-nose

15
推荐指数
2
解决办法
5742
查看次数

标签 统计

nose ×3

python ×3

django ×1

django-nose ×1

unit-testing ×1