gh-71339: Use new assertion methods in test_import and test_importlib (GH-129052)

This commit is contained in:
Serhiy Storchaka 2025-01-21 11:24:19 +02:00 committed by GitHub
parent da310d209a
commit f7cc7d296c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 51 additions and 54 deletions

View file

@ -125,12 +125,12 @@ def test_delete_eventual_attr(self):
# Deleting an attribute should stay deleted.
module = self.new_module()
del module.attr
self.assertFalse(hasattr(module, 'attr'))
self.assertNotHasAttr(module, 'attr')
def test_delete_preexisting_attr(self):
module = self.new_module()
del module.__name__
self.assertFalse(hasattr(module, '__name__'))
self.assertNotHasAttr(module, '__name__')
def test_module_substitution_error(self):
with test_util.uncache(TestingImporter.module_name):