add a contextmanager to disable the gc
diff --git a/Lib/test/support.py b/Lib/test/support.py
index ba53ab9..64864de 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -1005,6 +1005,16 @@
     gc.collect()
     gc.collect()
 
+@contextlib.contextmanager
+def disable_gc():
+    have_gc = gc.isenabled()
+    gc.disable()
+    try:
+        yield
+    finally:
+        if have_gc:
+            gc.enable()
+
 
 def python_is_optimized():
     """Find if Python was built with optimizations."""