mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #19760: Silence sysconfig's 'SO' key deprecation warnings in tests.
Change stacklevel in warnings.warn() for 'SO' key to 2.
This commit is contained in:
parent
59463d8340
commit
eaec3597dd
4 changed files with 10 additions and 8 deletions
|
@ -6,7 +6,7 @@ import unittest
|
|||
from distutils import sysconfig
|
||||
from distutils.ccompiler import get_default_compiler
|
||||
from distutils.tests import support
|
||||
from test.support import TESTFN, run_unittest
|
||||
from test.support import TESTFN, run_unittest, check_warnings
|
||||
|
||||
class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
@ -166,8 +166,9 @@ class SysconfigTestCase(support.EnvironGuard, unittest.TestCase):
|
|||
@unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
|
||||
'EXT_SUFFIX required for this test')
|
||||
def test_SO_value(self):
|
||||
self.assertEqual(sysconfig.get_config_var('SO'),
|
||||
sysconfig.get_config_var('EXT_SUFFIX'))
|
||||
with check_warnings(('', DeprecationWarning)):
|
||||
self.assertEqual(sysconfig.get_config_var('SO'),
|
||||
sysconfig.get_config_var('EXT_SUFFIX'))
|
||||
|
||||
@unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
|
||||
'EXT_SUFFIX required for this test')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue