diff options
Diffstat (limited to 'tests/16_test_supercommand.py')
-rw-r--r-- | tests/16_test_supercommand.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/16_test_supercommand.py b/tests/16_test_supercommand.py index d15ec797..f9172df7 100644 --- a/tests/16_test_supercommand.py +++ b/tests/16_test_supercommand.py @@ -25,15 +25,12 @@ class TestSuperCommand(unittest.TestCase): def test_import(self): """Test the importer itself""" - self.assertRaises(ImportError, - gbp.scripts.supercommand.import_command, - 'not.allowed') - self.assertRaises(ImportError, - gbp.scripts.supercommand.import_command, - 'not/allowed') - self.assertRaises(ImportError, - gbp.scripts.supercommand.import_command, - '0notallowed') + with self.assertRaises(ImportError): + gbp.scripts.supercommand.import_command('not.allowed') + with self.assertRaises(ImportError): + gbp.scripts.supercommand.import_command('not/allowed') + with self.assertRaises(ImportError): + gbp.scripts.supercommand.import_command('0notallowed') self.assertIsNotNone(gbp.scripts.supercommand.import_command('pq')) def test_invalid_command(self): |