Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset sys.excepthook. #122

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading