Skip to content

Commit

Permalink
t use custom exceptions instead of pytest asserts
Browse files Browse the repository at this point in the history
Co-Authored-By: Bernhard Raml <1769280+SwamyDev@users.noreply.github.com>
  • Loading branch information
isidore and SwamyDev committed May 30, 2022
1 parent e687ac2 commit 55c9c76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MultipleExceptions:
AssertionError: assert (1 % 2) == 0
AssertionError: assert (3 % 2) == 0
AssertionError: assert (5 % 2) == 0
ValueError: 1 is not odd!
ValueError: 3 is not odd!
ValueError: 5 is not odd!
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MultipleExceptions:
AssertionError: assert (1 % 2) == 0
AssertionError: assert (3 % 2) == 0
AssertionError: assert (5 % 2) == 0
ValueError: 1 is not odd!
ValueError: 3 is not odd!
ValueError: 5 is not odd!
3 changes: 2 additions & 1 deletion tests/test_exception_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@


def is_odd(integer):
assert integer % 2 == 0
if integer % 2 != 0:
raise ValueError(f"{integer} is not odd!")


def test_gather_all_exceptions():
Expand Down

0 comments on commit 55c9c76

Please sign in to comment.