pytest为常用fixture添加autouse选项 @pytest.fixture(autouse=True) def some(): return 1 def test_someA(): assert True def test_someB(): assert True