We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fb93a9 commit 66552f0Copy full SHA for 66552f0
Lib/test/test_dbm_gnu.py
@@ -1,5 +1,5 @@
1
from test import support
2
-from test.support import import_helper
+from test.support import import_helper, cpython_only
3
gdbm = import_helper.import_module("dbm.gnu") #skip if not supported
4
import unittest
5
import os
@@ -27,6 +27,13 @@ def tearDown(self):
27
self.g.close()
28
unlink(filename)
29
30
+ @cpython_only
31
+ def test_uninitialised_new(self):
32
+ # Prevent heap types from being created uninitialised (bpo-43916)
33
+ self.g = gdbm.open(filename, 'c')
34
+ tp = type(self.g)
35
+ self.assertRaises(TypeError, tp)
36
+
37
def test_key_methods(self):
38
self.g = gdbm.open(filename, 'c')
39
self.assertEqual(self.g.keys(), [])
0 commit comments