pytest 测试用例检索标准

 
  • If no arguments are specified then collection starts from testpaths (if configured) or the current directory. Alternatively, command line arguments can be used in any combination of directories, file names or node ids.
  • 如果没有参数指定,测试用例集合 从 testpaths(当有配置时) 或者当前目录收集.
  • 另外,命令行参数声明可以使用任何路径、文件名、节点ids 的组合来收集测试用例.
  • Recurse into directories, unless they match norecursedirs.
  • 递归到目录中,除非它们与norecursedirs匹配。
  • In those directories, search for test_*.py or *_test.py files, imported by their test package name.
  • 在这些路径下查找test_*.py or *_test.py  文件,通过测试包导入.
  • From those files, collect test items: 在这些文件中,收集测试用例
  • test prefixed test functions or methods outside of class
  • 在类外以test 开头的 函数
  • test prefixed test functions or methods inside Test prefixed test classes (without an __init__ method)
  • 在以Test 开头的类中以test 开头的 函数

原文地址:https://www.cnblogs.com/Daluo20200515/p/15517629.html