From 1eec325d9eabf3a00505cd1e283435eae1192f00 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Mon, 14 Mar 2016 22:26:15 -0700 Subject: [PATCH] Exception.message deprecated; just make sure which returns not None --- tests/test_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 0557688..7c06a9e 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -103,7 +103,7 @@ class Test_execute(TestToolsFilesystem): with self.assertRaises(ValueError) as ecm: execute([exe], logdir=None) e = ecm.exception - self.assertTrue('logdir must be a directory' in e.message) + self.assertTrue('logdir must be a directory' in e.args[0]) def test_execute_exception_when_logdir_enoent(self): exe = which('true') @@ -118,7 +118,7 @@ class Test_which(unittest.TestCase): def test_good_which_python(self): python = which('python') - self.assertIsInstance(python, str) + self.assertIsNotNone(python) self.assertTrue(os.path.isfile(python)) qualified_python = which(python) self.assertEqual(python, qualified_python)