summaryrefslogtreecommitdiffhomepage
path: root/tests/12_test_deb.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-11-12 17:48:03 +0100
committerGuido Günther <agx@sigxcpu.org>2017-11-12 17:48:03 +0100
commitdcf3e4f704285c7df84c425eb0fd8c3fecbc98c2 (patch)
tree85e09f927a33acccff32492b4aafdfc6a911a012 /tests/12_test_deb.py
parent57c671b7f2050edfb5a6e01330c2391bde04dbb5 (diff)
Use assertRaises as context manager
for better readability Gbp-Dch: Ignore
Diffstat (limited to 'tests/12_test_deb.py')
-rw-r--r--tests/12_test_deb.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/12_test_deb.py b/tests/12_test_deb.py
index 669896a4..d06bc432 100644
--- a/tests/12_test_deb.py
+++ b/tests/12_test_deb.py
@@ -156,7 +156,8 @@ class TestDpkgCompareVersions(unittest.TestCase):
self.assertEqual(ret, 0)
def testBadVersion(self):
- self.assertRaises(CommandExecFailed, self.cmp, '_', '_ _')
+ with self.assertRaises(CommandExecFailed):
+ self.cmp('_', '_ _')
@unittest.skipIf(not os.path.exists('/usr/bin/dpkg'), 'Dpkg not found')