[3.13] gh-71339: Use new assertion methods in test_import and test_importlib (GH-129052) (#129123)

(cherry picked from commit f7cc7d296c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Serhiy Storchaka 2025-04-08 13:43:04 +03:00 committed by GitHub
parent d2ec87f740
commit a9bb0092d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 68 additions and 64 deletions

View file

@ -10,6 +10,7 @@
from test.support import import_helper
from test.support import is_apple_mobile
from test.support import os_helper
from test.support.testcase import ExtraAssertions
import unittest
import sys
import tempfile
@ -80,7 +81,7 @@ def specialize_class(cls, kind, base=None, **kwargs):
elif not isinstance(base, type):
base = base[kind]
name = '{}_{}'.format(kind, cls.__name__)
bases = (cls, base)
bases = (cls, base, ExtraAssertions)
specialized = types.new_class(name, bases)
specialized.__module__ = cls.__module__
specialized._NAME = cls.__name__