Skip to content

Commit ff31644

Browse files
committed
Tweaked assertion() and unreachable() to raise an exception instead of sending email (to the test mailbox ...) when running the test suite.
- Legacy-Id: 12977
1 parent 19121c4 commit ff31644

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/utils/log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Traceback():
6464
frame = inspect.stack()[1][0]
6565
value = eval(statement, frame.f_globals, frame.f_locals)
6666
if not value:
67-
if settings.DEBUG is True:
67+
if settings.DEBUG is True or settings.SERVER_MODE == 'test':
6868
raise AssertionError("Assertion '%s' failed." % (statement,))
6969
else:
7070
# build a simulated traceback object
@@ -80,7 +80,7 @@ def unreachable():
8080
class Traceback():
8181
pass
8282
frame = inspect.stack()[1][0]
83-
if settings.DEBUG is True:
83+
if settings.DEBUG is True or settings.SERVER_MODE == 'test':
8484
raise AssertionError("Arrived at code in %s() which was marked unreachable." % frame.f_code.co_name)
8585
else:
8686
# build a simulated traceback object

0 commit comments

Comments
 (0)