improve code in tests

- use 'assertRaises' as context manager
- remove calls to .keys()
This commit is contained in:
Mike Fährmann
2019-05-13 11:48:20 +02:00
parent ba8eb1ffec
commit a5b060765d
3 changed files with 19 additions and 13 deletions

View File

@@ -55,7 +55,8 @@ class TestExtractorResults(unittest.TestCase):
if not result:
return
if "exception" in result:
self.assertRaises(result["exception"], tjob.run)
with self.assertRaises(result["exception"]):
tjob.run()
return
try:
tjob.run()