PyTest teardown_class is being run too soon
问题 The Python "teardown_class" is not behaving as I expect it to. Below is a summary of my code: @classmethod def setup_class(cls): cls.create_table(table1) cls.create_table(table2) cls.create_table(table3) @classmethod def create_table(cls, some_arg_here): """Some code here that creates the table""" def test_foo(self): """Some test code here""" @classmethod def teardown_class(cls): """Perform teardown things""" I believe the way it is executing is that: create_table is being called from setup