|
9 | 9 | import tempfile |
10 | 10 | import textwrap |
11 | 11 | import unittest |
12 | | -import warnings |
13 | 12 | from test import support |
14 | 13 | from test.support import os_helper |
15 | 14 | from test.support import force_not_colorized |
@@ -943,21 +942,15 @@ def test_python_asyncio_debug(self): |
943 | 942 |
|
944 | 943 | @unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option") |
945 | 944 | def test_python_dump_refs(self): |
946 | | - code = 'import sys; sys._clear_type_cache()' |
947 | | - # TODO: Remove warnings context manager once sys._clear_type_cache is removed |
948 | | - with warnings.catch_warnings(): |
949 | | - warnings.simplefilter("ignore", DeprecationWarning) |
950 | | - rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1') |
| 945 | + code = 'import sys; sys._clear_internal_caches()' |
| 946 | + rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1') |
951 | 947 | self.assertEqual(rc, 0) |
952 | 948 |
|
953 | 949 | @unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option") |
954 | 950 | def test_python_dump_refs_file(self): |
955 | 951 | with tempfile.NamedTemporaryFile() as dump_file: |
956 | | - code = 'import sys; sys._clear_type_cache()' |
957 | | - # TODO: Remove warnings context manager once sys._clear_type_cache is removed |
958 | | - with warnings.catch_warnings(): |
959 | | - warnings.simplefilter("ignore", DeprecationWarning) |
960 | | - rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFSFILE=dump_file.name) |
| 952 | + code = 'import sys; sys._clear_internal_caches()' |
| 953 | + rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFSFILE=dump_file.name) |
961 | 954 | self.assertEqual(rc, 0) |
962 | 955 | with open(dump_file.name, 'r') as file: |
963 | 956 | contents = file.read() |
|
0 commit comments