Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 22-11-2022 04:38PM
    #1
    Registered Users, Registered Users 2 Posts: 5,753 ✭✭✭


    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