Skip to content

Commit

Permalink
add test_level--accounts for __debug; fix to add TestDebug2 script_mo…
Browse files Browse the repository at this point in the history
…dule
  • Loading branch information
tomasohara committed Jan 13, 2024
1 parent dea23d2 commit ddc5fb5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mezcla/tests/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
from mezcla.unittest_wrapper import TestWrapper

# Note: Two references are used for the module to be tested:
# THE_MODULE: global module object
# THE_MODULE: global module object
# TestIt.script_module: path to file
import mezcla.debug as THE_MODULE # pylint: disable=reimported

# Environment options
Expand Down Expand Up @@ -432,6 +433,7 @@ def test_hidden_simple_trace(self, capsys):

class TestDebug2(TestWrapper):
"""Another Class for test case definitions"""
script_module = TestWrapper.get_testing_module_name(__file__, THE_MODULE)

def test_xor3_again(self):
"""Test xor3 again"""
Expand All @@ -440,6 +442,14 @@ def test_xor3_again(self):
self.do_assert(not debug.xor3(True, True, True))
self.do_assert(not debug.xor3(False, False, False))

@pytest.mark.xfail
def test_level(self):
""""Make sure set_level honored (provided __debug__)"""
old_level = debug.get_level()
new_level = old_level + 1
debug.set_level(new_level)
expected_level = (new_level if __debug__ else old_level)
self.do_assert(debug.get_level() == expected_level)

#------------------------------------------------------------------------

Expand Down

0 comments on commit ddc5fb5

Please sign in to comment.