Skip to content

Commit 6f34de5

Browse files
Skipping test instead of succeeding if method not implemented for submodule
1 parent 166a553 commit 6f34de5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_dbm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_anydbm_readonly_reorganize(self):
140140
with dbm.open(_fname, 'r') as d:
141141
# Early stopping.
142142
if not hasattr(d, 'reorganize'):
143-
return
143+
self.skipTest(f"method reorganize not available this dbm submodule")
144144

145145
self.assertRaises(dbm.error, lambda: d.reorganize())
146146

@@ -149,7 +149,7 @@ def test_anydbm_reorganize_not_changed_content(self):
149149
with dbm.open(_fname, 'c') as d:
150150
# Early stopping.
151151
if not hasattr(d, 'reorganize'):
152-
return
152+
self.skipTest(f"method reorganize not available this dbm submodule")
153153

154154
keys_before = sorted(d.keys())
155155
values_before = [d[k] for k in keys_before]
@@ -175,7 +175,7 @@ def _calculate_db_size(db_path):
175175
with dbm.open(_fname, 'n') as f:
176176
# Early stopping.
177177
if not hasattr(f, 'reorganize'):
178-
return
178+
self.skipTest(f"method reorganize not available this dbm submodule")
179179

180180
for k in self._dict:
181181
f[k.encode('ascii')] = self._dict[k] * 100000

0 commit comments

Comments
 (0)