diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-11-12 17:48:03 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-11-12 17:48:03 +0100 |
commit | dcf3e4f704285c7df84c425eb0fd8c3fecbc98c2 (patch) | |
tree | 85e09f927a33acccff32492b4aafdfc6a911a012 /tests/15_test_DebianSource.py | |
parent | 57c671b7f2050edfb5a6e01330c2391bde04dbb5 (diff) |
Use assertRaises as context manager
for better readability
Gbp-Dch: Ignore
Diffstat (limited to 'tests/15_test_DebianSource.py')
-rw-r--r-- | tests/15_test_DebianSource.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/15_test_DebianSource.py b/tests/15_test_DebianSource.py index 98d5f706..f7f333b6 100644 --- a/tests/15_test_DebianSource.py +++ b/tests/15_test_DebianSource.py @@ -36,8 +36,8 @@ class TestDebianSource(testutils.DebianGitTestRepo): """Test native package of format 3""" source = DebianSource('.') os.makedirs('debian/source') - self.assertRaises(DebianSourceError, - source.is_native) + with self.assertRaises(DebianSourceError): + source.is_native() dsf = DebianSourceFormat.from_content("3.0", "native") self.assertEqual(dsf.type, 'native') @@ -51,8 +51,8 @@ class TestDebianSource(testutils.DebianGitTestRepo): """Test native package without a debian/source/format file""" source = DebianSource('.') os.makedirs('debian/') - self.assertRaises(DebianSourceError, - source.is_native) + with self.assertRaises(DebianSourceError): + source.is_native() with open('debian/changelog', 'w') as f: f.write("""git-buildpackage (0.2.3) git-buildpackage; urgency=low |