Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Pytest how to ignore the setup class in an autouse test fixture

Options
  • 22-11-2022 4:38pm
    #1
    Registered Users Posts: 5,541 ✭✭✭


    The below code runs after every function including the setup class. I dont create an instance before the actual tests so i don't want it to run after the setup_class method. Can you advise if i can change the signature to not run after setup class

    @pytest.fixture(autouse=True)
    def teardown_module(self):
        Log.test_teardown("Deleting instance")
        Utils.compute_utils().delete_instance_and_wait_for_state(
            TestAutoValidateCpuAlignment.instance_id, teardown=True)
    




Advertisement