def test_modes(self): for mode in ['r', 'rw', 'w', 'n']: try: self.d = dbm.ndbm.open(self.filename, mode) self.d.close() except error: self.fail()