pytest

作者: 爱吃葡萄冰的鲸 | 来源:发表于2017-05-23 16:12 被阅读14次

Specifying tests / selecting tests
Several test run options:

  • pytest test_mod.py # run tests in module
  • pytest somepath # run all tests below somepath
  • pytest -k stringexpr # only run tests with names that match the "string expression", e.g. "MyClass and not method" will select TestMyClass.test_something but not TestMyClass.test_method_simple
  • pytest test_mod.py::test_func # only run tests that match the "node ID", e.g. "test_mod.py::test_func" will select only test_func in test_mod.py
  • pytest test_mod.py::TestClass::test_method # run a single method in a single class

相关文章

网友评论

      本文标题:pytest

      本文链接:https://www.haomeiwen.com/subject/xwcgxxtx.html