Skip to content

Commit

Permalink
Merge pull request #122 from tonyandrewmeyer/reset-sys-excepthook-102
Browse files Browse the repository at this point in the history
Reset sys.excepthook.
  • Loading branch information
PietroPasotti authored Apr 18, 2024
2 parents 3029150 + 194f52d commit 97b50f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scenario/ops_main_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See LICENSE file for licensing details.
import inspect
import os
import sys
from typing import TYPE_CHECKING, Any, Optional, Sequence, cast

import ops.charm
Expand Down Expand Up @@ -96,6 +97,9 @@ def setup_framework(
)
debug = "JUJU_DEBUG" in os.environ
setup_root_logging(model_backend, debug=debug)
# ops sets sys.excepthook to go to Juju's debug-log, but that's not useful
# in a testing context, so reset it.
sys.excepthook = sys.__excepthook__
ops_logger.debug(
"Operator Framework %s up and running.",
ops.__version__,
Expand Down

0 comments on commit 97b50f8

Please sign in to comment.