fixtrue 在不使用autouse=True时,scope="module" "session"的调用有其他形式吗?

@pytest.fixture(scope="module")
def myfixture():
    print("执行我的fixture")

myfixture的作用域为module,即py文件中只执行一次

但是不使用autouse=True时,在py文件中要调用myfixture则需要在class的def中添加myfixtrue

test_fixture.py

class Test_demo():
    def test_one(self,myfixture):
        print("执行test_one")
        assert 1+1==2

虽然在test_fixture.py中在多少个class中添加myfixtur都只执行一次

但在代码理解上 ,setup_module显然更易读,而且autouse=True明显不科学

所以fixture只能在def()中作为参数传进去这一种调用方法吗?

image