Issue #19527: Fixed tests with defined COUNT_ALLOCS.
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index c11408d..32edff8 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -763,6 +763,9 @@
 
         with open(filename) as fp:
             reflog = fp.read()
+            if hasattr(sys, 'getcounts'):
+                # Types are immportal if COUNT_ALLOCS is defined
+                reflog = reflog.splitlines(True)[-1]
             self.assertEqual(reflog, line2)
 
     def test_list_tests(self):