bpo-43988: Use check disallow instantiation helper (GH-26392)

This commit is contained in:
Erlend Egeberg Aasland 2021-05-27 08:43:52 +02:00 committed by GitHub
parent 3e7ee02327
commit fbff5387c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 37 additions and 51 deletions

View file

@ -31,8 +31,7 @@ class TestGdbm(unittest.TestCase):
def test_disallow_instantiation(self):
# Ensure that the type disallows instantiation (bpo-43916)
self.g = gdbm.open(filename, 'c')
tp = type(self.g)
self.assertRaises(TypeError, tp)
support.check_disallow_instantiation(self, type(self.g))
def test_key_methods(self):
self.g = gdbm.open(filename, 'c')