File indexing completed on 2025-05-14 07:57:12
0001 import acts
0002 import pytest
0003
0004
0005 def test_logging_threshold():
0006 assert acts.logging.getFailureThreshold() == acts.logging.Level.WARNING
0007
0008
0009 def test_logging_threshold_context_manager():
0010 with acts.logging.ScopedFailureThreshold(acts.logging.ERROR):
0011 assert acts.logging.getFailureThreshold() == acts.logging.Level.ERROR
0012 assert acts.logging.getFailureThreshold() == acts.logging.Level.WARNING
0013
0014
0015 def test_logging_threshold_context_manager_exception():
0016 with pytest.raises(RuntimeError):
0017 with acts.logging.ScopedFailureThreshold(level=acts.logging.ERROR):
0018 assert acts.logging.getFailureThreshold() == acts.logging.Level.ERROR
0019 raise RuntimeError("test")
0020 assert acts.logging.getFailureThreshold() == acts.logging.Level.WARNING