|
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 |
@@ -937,21 +936,15 @@ def test_python_asyncio_debug(self): |
937 | 936 |
|
938 | 937 | @unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option") |
939 | 938 | def test_python_dump_refs(self): |
940 | | - code = 'import sys; sys._clear_type_cache()' |
941 | | - # TODO: Remove warnings context manager once sys._clear_type_cache is removed |
942 | | - with warnings.catch_warnings(): |
943 | | - warnings.simplefilter("ignore", DeprecationWarning) |
944 | | - rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1') |
| 939 | + code = 'import sys; sys._clear_internal_caches()' |
| 940 | + rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1') |
945 | 941 | self.assertEqual(rc, 0) |
946 | 942 |
|
947 | 943 | @unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option") |
948 | 944 | def test_python_dump_refs_file(self): |
949 | 945 | with tempfile.NamedTemporaryFile() as dump_file: |
950 | | - code = 'import sys; sys._clear_type_cache()' |
951 | | - # TODO: Remove warnings context manager once sys._clear_type_cache is removed |
952 | | - with warnings.catch_warnings(): |
953 | | - warnings.simplefilter("ignore", DeprecationWarning) |
954 | | - rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFSFILE=dump_file.name) |
| 946 | + code = 'import sys; sys._clear_internal_caches()' |
| 947 | + rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFSFILE=dump_file.name) |
955 | 948 | self.assertEqual(rc, 0) |
956 | 949 | with open(dump_file.name, 'r') as file: |
957 | 950 | contents = file.read() |
|
0 commit comments