Yan*_*ang 17 python testing doctest pytest
我们目前py.test使用coverage插件在tests目录中运行我们的测试.
py.test
tests
从主代码中提取doctests的最简单方法是什么? --doctest-modules不起作用(可能因为它只是运行doctests tests).请注意,我们希望在同一进程中包含doctests(而不是简单地运行单独的调用py.test),因为我们希望在代码覆盖率中考虑doctest.
--doctest-modules
dmi*_*nov 15
现在实施:-).
要使用,请运行py.test --doctest-modules命令,或使用以下命令设置配置pytest.ini:
py.test --doctest-modules
pytest.ini
$ cat pytest.ini # content of pytest.ini [pytest] addopts = --doctest-modules
手册页:PyTest:模块和测试文件的doctest集成.
归档时间:
12 年,7 月 前
查看次数:
3872 次
最近记录:
7 年,2 月 前