bpo-37146: Deactivate opcode cache only when using huntrleaks in the test suite (GH-24643)

diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py
index 1f264c1..7738d4f 100644
--- a/Lib/test/libregrtest/setup.py
+++ b/Lib/test/libregrtest/setup.py
@@ -62,6 +62,7 @@ def setup_tests(ns):
 
     if ns.huntrleaks:
         unittest.BaseTestSuite._cleanup = False
+        sys._deactivate_opcache()
 
     if ns.memlimit is not None:
         support.set_memlimit(ns.memlimit)