Python 测试后如何启动脚本?

Python 测试后如何启动脚本?,python,pytest,Python,Pytest,我有任何pytest.fixture-autostart的测试前方法,我需要更改此方法并在测试后开始,如何更改此方法?或者我应该添加任何选项 @pytest.fixture(autouse=True, scope="session") def beforescript(self): Test.startScriptTest() 谢谢你的回答 @pytest.fixture(autouse=True,scope=“session”)) 测试后的def(自): 产量 Tes

我有任何pytest.fixture-autostart的测试前方法,我需要更改此方法并在测试后开始,如何更改此方法?或者我应该添加任何选项

@pytest.fixture(autouse=True, scope="session")
    def beforescript(self):
        Test.startScriptTest()
谢谢你的回答

@pytest.fixture(autouse=True,scope=“session”))
测试后的def(自):
产量
Test.postertestscript()

这可能对您有用,它应该在测试之前开始,并在测试完成后继续进行

为什么不在
tearDown
方法中调用您的脚本?您可以在“设置”内置功能中编写它。