跳转到主要内容

Nose插件,按类/模块分组打印更漂亮的点。

项目描述

这是一个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将不会重复失败输出。

它也是一个测试地址

每个模块或类组也同时作为您可以给Nose的参数,如果您想重新运行该组测试。从上面的输出中,您可以复制/粘贴并像这样重新运行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结果,则将与Nice Dots冲突。

  • 目前支持Python 2.5、2.6和2.7。其他版本可能或可能不支持。Python 3目前不支持。有几个失败的测试。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

nosenicedots-0.5.tar.gz (9.9 kB 查看哈希值)

上传时间

支持者