Pytest之模块之间共享skipif标记
test_caseskip.py
#coding:utf-8 import pytest myskip=pytest.mark.skipif(1==1,reason="skip")
test_m1.py
#coding:utf-8 import pytest from test_caseskip import myskip class Test(): @myskip def test_one(self): print("test_one方法执行") assert 1 == 1 def test_two(self): print("test_two方法执行") assert 'o' in 'love' if __name__ == "__main__": pytest.main(["-rs", "test_m1.py"])