Skip to content

Commit

Permalink
uses default trace level to enable expression extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom O'Hara committed Sep 24, 2023
1 parent c1aa76b commit 3805ad4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mezcla/unittest_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def do_assert(self, condition, message=None):
- Formatted similar to debug.assertion:
Test assertion failed: <expr> (at <f><n>): <msg>
"""
if ((not condition) and debug.debugging()):
if ((not condition) and debug.debugging(debug.TL.DEFAULT)):
statement = filename = line_num = None
try:
# note: accounts for trap_exception and other decorators
Expand Down Expand Up @@ -363,6 +363,8 @@ def do_assert(self, condition, message=None):
# Format assertion error with optional qualification (i.e., user message)
debug.trace(1, f"Test assertion failed: {expr} (at {filename}:{line_num}){qual}")
debug.trace(5, f"\t{statement}")
else:
system.print_error("Warning: unexpected condition in do_assert")
assert(condition)

def tearDown(self):
Expand Down

0 comments on commit 3805ad4

Please sign in to comment.