pytest . class

#在当前测试类的开始与结束执行。
setup_class
teardown_class

#在每个测试方法开始与结束执行。
setup
teardown

#在每个测试方法开始与结束执行,与setup/treadown级别相同
setup_method
teardown_method     



参考:
https://github.com/ftobia/pytest-ordering
https://pytest-ordering.readthedocs.io/en/develop/
https://www.jianshu.com/p/38e1e62e9c8e
https://blog.csdn.net/flydedog/article/details/79567019
https://www.cnblogs.com/yoyoketang/p/9492132.html

原文地址:https://www.cnblogs.com/sea-stream/p/11549323.html