Skip to content

Commit

Permalink
Do not pass local func to Process(target=)...
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Dec 2, 2024
1 parent 0a66a27 commit 43279b9
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/ctapipe/core/tests/test_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,23 +544,15 @@ def test_exit_status_interrupted(tmp_path, provenance):
class MyTool(Tool):
name = "test-interrupt"

def __init__(self, **kwargs):
super().__init__(**kwargs)

def start(self):
barrier.wait()
signal.pause()

provenance_path = tmp_path / "provlog.json"

def main():
run_tool(
MyTool(),
[f"--provenance-log={provenance_path}", "--log-level=INFO"],
raises=False,
)

process = Process(target=main)
args = [f"--provenance-log={provenance_path}", "--log-level=INFO"]
tool = MyTool()
process = Process(target=run_tool, args=(tool, args), kwargs=dict(raises=False))
process.start()
barrier.wait()

Expand Down

0 comments on commit 43279b9

Please sign in to comment.