我对Python相当陌生,正在尝试学习工具集。在
我已经知道如何让py.test -f
在编写代码时监视我的测试。有一件事我还没弄明白,是否有一种方法可以让观察者变得更聪明,就像Ruby的Guard库一样。在
使用guard+minitest,我得到的行为是,如果我保存一个像my_class.rb
的文件,然后执行my_class_test.rb
,如果我在cli中点击enter
,它将运行所有测试。在
到目前为止,使用pytest,我还不能找到一种方法来只运行与最后一次接触的文件相对应的测试文件,从而避免了等待整个测试套件运行,直到当前文件通过为止。在
你们这些Python会怎么做?在
谢谢!在
还有一个pytest-xdist具有一个称为:
一种可能是将pytest-testmon与pytest-watch一起使用。在
它使用coverage.py来跟踪哪个测试触及了哪一行代码,一旦您更改了一行代码,它就会重新运行以某种方式执行该行的所有测试。在
要添加到上述编译器的答案中,您可以使用pytest watch的
runner
选项让pytest-testmon和{a2}一起玩:相关问题 更多 >
编程相关推荐