mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings, and internal test warnings that are now logged (#128973)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
972a295fe3
commit
8a00c9a4d2
15 changed files with 232 additions and 137 deletions
|
@ -10,6 +10,7 @@ import hashlib
|
|||
import importlib
|
||||
import io
|
||||
import itertools
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import sysconfig
|
||||
|
@ -113,7 +114,11 @@ class HashLibTestCase(unittest.TestCase):
|
|||
return importlib.import_module(module_name)
|
||||
except ModuleNotFoundError as error:
|
||||
if self._warn_on_extension_import and module_name in builtin_hashes:
|
||||
warnings.warn(f'Did a C extension fail to compile? {error}')
|
||||
logging.getLogger(__name__).warning(
|
||||
'Did a C extension fail to compile? %s',
|
||||
error,
|
||||
exc_info=error,
|
||||
)
|
||||
return None
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue