pytest的testdox格式报告程序

pytest-testdox的Python项目详细描述


https://travis-ci.org/renanivo/pytest-testdox.svg?branch=masterhttps://codecov.io/gh/renanivo/pytest-testdox/branch/master/graph/badge.svg

pytest的TestDox format报告者

http://i.imgur.com/rJRL4x9.png

安装

pip install pytest-testdox

用法

运行pytest时添加参数testdox。示例:

pytest --testdox your-tests/

提示:如果不想每次运行pytest时都键入--testdox,请添加它 到addopts 在你的ini file里。示例:

# content of pytest.ini# (or tox.ini or setup.cfg)[pytest]addopts=--testdox

标记

@pytest.mark.describe

重写testdox报告中的类名。示例

# test_demo.py@pytest.mark.describe('create_file')classTestCreateFile():deftest_creates_a_file_in_the_so(self):pass

将产生输出:

test_demo.py

create_file
 [x] creates a file in the so

@pytest.mark.it

重写testdox报告中的测试标题。示例:

# test_demo.pyclassTestCreateFile():@pytest.mark.it('Creates a local file in the SO')deftest_creates_a_file_in_the_so(self):pass

将产生输出:

test_demo.py

Create File
 [x] Creates a local file in the SO

配置文件选项

testdox_格式

指定testdox报告格式,plaintextutf8(默认: utf8)。示例:

# content of pytest.ini# (or tox.ini or setup.cfg)[pytest]testdox_format=plaintext
$ pytest test_demo.py
============================= test session starts ==============================
platform darwin -- Python 3.5.0, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
rootdir: /private/tmp/demo, inifile: pytest.ini
plugins: testdox-dev
collected 2 items

test_demo.py
Pytest Testdox
 [x] prints a BDD style output to your tests
 [x] lets you focus on the behavior

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java模拟存储库对象从controller testcase返回空结果?   Java扫描程序跳行异常   c#混淆If语句?   java为什么日志中的stacktrace前面没有这一行?   java如何使SSHJ在非标准端口上启动出站SFTP?   java我如何确定为什么每周收入没有在我的程序中显示前三次?   java如何判断堆叠条形图的轴的行为?   java rest json API的Web服务器体系结构   java ClassCastException:javax。摆动按扭   Java在Linux上不读取excel文件(使用Apache POI)   反馈错误后,java Wicket 1.4.9无法从modal使用AjaxRequestTarget!   java方法头中“静态”的含义是什么?   java无法在我的tomcat应用程序中添加外部库   java使用Itext Pdf将图像添加到Pdf文件   java为什么当我调用universe时java3d会闪烁。getCanvas()。getView()。重新油漆();   java Gson嵌套类在使用proguard时为空   java如何确定JSON路径对文档是否有效   java在使用Jsoup解析时保持HTML布尔属性的原始形式   使用Java SDK,如何在Azure存储文件服务中为文件设置元数据?