diff options
author | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-05-14 21:21:54 +0200 |
---|---|---|
committer | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-05-14 21:22:56 +0200 |
commit | 2f952abf82c36c817cbbc1e3654b990a496d50ad (patch) | |
tree | 967107030d106ddc5e8f92aa1f58d07340cf008f /tests/test_cards.py | |
parent | db28b4b078da5fcd15247a1c1b757ad5daee397f (diff) |
Use unittest machanism to assert on exceptions
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'tests/test_cards.py')
-rw-r--r-- | tests/test_cards.py | 12 |
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.") |