打印按类/模块分组的更好点的nose插件。
nosenicedots的Python项目详细描述
它是一个nosetests插件,可以打印按类/模块分组的更好的点。
安装
来自PYPI:
pip install nosenicedots
或来源:
pip install -e git+git://github.com/kumar303/nose-nicedots.git#egg=nosenicedots
用法
nosetests --with-nicedots
示例
$ nosetests --with-nicedots apps/devhub/tests/test_views.py:TestActivity .............. apps/devhub/tests/test_views.py:TestAddVersion . ====================================================================== FAIL: apps/devhub/tests/test_views.py:TestAddVersion.test_unique_version_num ---------------------------------------------------------------------- Traceback (most recent call last): File "/path/to/apps/devhub/tests/test_views.py", line 3132, in test_unique_version_num assert 0 AssertionError apps/devhub/tests/test_views.py:TestCreateFoobar .. apps/devhub/tests/test_views.py:TestDashboard ..... apps/devhub/tests/test_views.py:TestDelete .. ====================================================================== FAIL: apps/devhub/tests/test_views.py:TestAddVersion.test_unique_version_num ---------------------------------------------------------------------- Traceback (most recent call last): File "/path/to/apps/devhub/tests/test_views.py", line 3132, in test_unique_version_num assert 0 AssertionError ---------------------------------------------------------------------- Ran 44 tests in 1.62s FAILED (failures=1)
这种新的输出样式旨在作为一个更有用的测试报告, 灵感来自py.test。而不是一堆乱七八糟的点 您将看到模块或类的打印输出,后面跟着点,指示 那组的每个测试。
您将立即看到故障的回溯,它是为 长时间运行的测试套件。注意,在 底部,以防输出已经滚动出屏幕。使用 --stop不会复制失败输出。
它也是一个测试地址
每个模块或类组也可以作为参数加倍,如果 你想重新运行那组测试。从上面的输出你可以 复制/粘贴并重新运行TestActivity类中的测试,如下所示:
$ nosetests --with-nicedots apps/devhub/tests/test_views.py:TestActivity apps/devhub/tests/test_views.py:TestActivity .............. ---------------------------------------------------------------------- Ran 14 tests in 0.62s OK
注意事项
- 如果其他插件需要修补unittest结果,那么它将 与漂亮的圆点冲突。
- 目前支持Python2.5、2.6和2.7。其他版本可以或 可能不起作用。python 3不支持。有一些失败 测验。