Skip to content

Commit

Permalink
Add module to sys.modules (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-runkle authored Aug 13, 2024
1 parent 8519acc commit 3108a2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pytest_examples/run_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def run_code(
module.__dict__.update(module_globals)
try:
with insert_print:
sys.modules[spec.name] = module
spec.loader.exec_module(module)
except KeyboardInterrupt:
print('KeyboardInterrupt in example')
Expand Down

0 comments on commit 3108a2c

Please sign in to comment.