summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2020-05-14 21:21:54 +0200
committerOlivier Gayot <olivier.gayot@sigexec.com>2020-05-14 21:22:56 +0200
commit2f952abf82c36c817cbbc1e3654b990a496d50ad (patch)
tree967107030d106ddc5e8f92aa1f58d07340cf008f
parentdb28b4b078da5fcd15247a1c1b757ad5daee397f (diff)
Use unittest machanism to assert on exceptions
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
-rw-r--r--tests/test_cards.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/test_cards.py b/tests/test_cards.py
index 019d512..ea49847 100644
--- a/tests/test_cards.py
+++ b/tests/test_cards.py
@@ -13,15 +13,7 @@ class TestCards(unittest.TestCase):
self.assertTrue(Cards.get_black_cards("en"))
def test_get_cards_unknown_language(self):
- try:
+ with self.assertRaises(FileNotFoundError):
Cards.get_white_cards("zz")
- except FileNotFoundError:
- pass
- else:
- self.fail("Found zz white cards.")
- try:
+ with self.assertRaises(FileNotFoundError):
Cards.get_black_cards("zz")
- except FileNotFoundError:
- pass
- else:
- self.fail("Found zz black cards.")