summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-05-25 22:12:54 (GMT)
committerGitHub <noreply@github.com>2022-05-25 22:12:54 (GMT)
commit518595652759462b13904df767f69b8cc2c61143 (patch)
tree28cf498655b4c223ab6e6daab68408663a196c3f /Lib/test/test_warnings
parentca58e4a2c596d1b4cdcae9ec92844d3d3272c4ce (diff)
downloadcpython-518595652759462b13904df767f69b8cc2c61143.zip
cpython-518595652759462b13904df767f69b8cc2c61143.tar.gz
cpython-518595652759462b13904df767f69b8cc2c61143.tar.bz2
gh-69443: Add test.support.Py_DEBUG constant (#93226)
Diffstat (limited to 'Lib/test/test_warnings')
-rw-r--r--Lib/test/test_warnings/__init__.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py
index 0f960b8..b00ddd5 100644
--- a/Lib/test/test_warnings/__init__.py
+++ b/Lib/test/test_warnings/__init__.py
@@ -22,8 +22,6 @@ py_warnings = import_helper.import_fresh_module('warnings',
c_warnings = import_helper.import_fresh_module('warnings',
fresh=['_warnings'])
-Py_DEBUG = hasattr(sys, 'gettotalrefcount')
-
@contextmanager
def warnings_state(module):
"""Use a specific warnings implementation in warning_tests."""
@@ -1191,7 +1189,7 @@ class EnvironmentVariableTests(BaseTest):
def test_default_filter_configuration(self):
pure_python_api = self.module is py_warnings
- if Py_DEBUG:
+ if support.Py_DEBUG:
expected_default_filters = []
else:
if pure_python_api: