Skip to content

Commit b3821b0

Browse files
authored
Merge pull request #3 from FArekkusu/master
2 parents d1d33dd + 4aa303a commit b3821b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

codewars_test/test_framework.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ def expect_error(message, function, exception=Exception):
5757

5858

5959
def expect_no_error(message, function, exception=BaseException):
60-
passed = True
6160
try:
6261
function()
63-
except exception:
64-
passed = False
62+
except exception as e:
63+
fail("{}: {}".format(message or "Unexpected exception", repr(e)))
64+
return
6565
except Exception:
6666
pass
67-
expect(passed, message)
67+
pass_()
6868

6969

7070
def pass_(): expect(True)
@@ -137,7 +137,7 @@ def some_tests():
137137
def timeout(sec):
138138
def wrapper(func):
139139
from multiprocessing import Process
140-
msg = 'Should not throw any exception inside timeout'
140+
msg = 'Should not throw any exceptions inside timeout'
141141

142142
def wrapped():
143143
expect_no_error(msg, func)

0 commit comments

Comments
 (0)