diff --git a/test/inductor/test_max_autotune.py b/test/inductor/test_max_autotune.py index f5339774368d9..58f1ae439abdf 100644 --- a/test/inductor/test_max_autotune.py +++ b/test/inductor/test_max_autotune.py @@ -4149,6 +4149,11 @@ def setUpClass(cls): ) ) + @classmethod + def tearDownClass(cls): + cls._stack.close() + super().tearDownClass() + def check_code(self, code_str, num_kernels, num_allocs, num_deallocs): FileCheck().check(get_func_call()).check_count( get_kernel_launch(), @@ -4642,6 +4647,11 @@ def setUpClass(cls): ) ) + @classmethod + def tearDownClass(cls): + cls._stack.close() + super().tearDownClass() + @contextlib.contextmanager def get_common_patches( self,