assert proper errors

This commit is contained in:
meejah 2019-12-21 18:01:42 -07:00
parent f8117320cb
commit 29563b8f2d
2 changed files with 4 additions and 4 deletions

View File

@ -60,7 +60,7 @@ class BackupDB(unittest.TestCase):
bdb = backupdb.get_backupdb(where, stderr_f)
self.failUnlessEqual(bdb, None)
stderr = stderr_f.getvalue()
self.failUnlessIn("Could not open database", stderr)
self.failUnlessIn("unable to open database file", stderr)
def writeto(self, filename, data):

View File

@ -157,9 +157,9 @@ class NoDefault(unittest.TestCase):
self.yaml_path.setContent(EQUALS_YAML)
with self.assertRaises(TypeError) as ctx:
yield create_client(self.basedir)
self.assertEquals(
str(ctx.exception),
"string index must be an integer, not str",
self.assertIsInstance(
ctx.exception,
TypeError,
)
@defer.inlineCallbacks