[英]How to run all doctests in a folder recursively in pycharm?
Pycharm is great for running all of the doctests per (script / function / class / folder*) but the folder option runs all doctests which are immediately within that folder (not within folders of that folder). Pycharm 非常适合按(脚本/函数/类/文件夹*)运行所有 doctests,但文件夹选项运行该文件夹内(而不是该文件夹的文件夹内)的所有 doctests。
Is there a way to recursively run through some top level folder and run all doctests found?有没有办法递归运行某个顶级文件夹并运行找到的所有 doctests?
This can be done from PyCharm with the help of pytest
:这可以在pytest
的帮助下从 PyCharm 完成:
pytest
by running pip install -U pytest
如果你不已经拥有了它,安装pytest
运行pip install -U pytest
--doctest-modules
to the Additional Arguments field将--doctest-modules
添加到附加参数字段Now running the newly created configuration will discover and run all doctests, even those in subdirectories.现在运行新创建的配置将发现并运行所有 doctests,甚至是子目录中的那些。
See PyCharm's documentation for more configuration options.有关更多配置选项,请参阅PyCharm 的文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.