diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index b1775ba7d81e521..3879c49c714dd9b 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -11300,6 +11300,7 @@ def test_all_exported_names(self): def test_any_str_deprecated(self): # gh-105578 fresh = import_helper.import_fresh_module('typing') + self.addCleanup(atexit.unregister, fresh._clear_caches) with self.assertWarnsRegex(DeprecationWarning, r'typing\.AnyStr'): fresh.AnyStr