We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb1c379 commit 14191d3Copy full SHA for 14191d3
tests/test_examples.py
@@ -1,6 +1,7 @@
1
# SPDX-License-Identifier: Apache-2.0
2
"""Tests of example Python scripts."""
3
import os
4
+import runpy
5
from pathlib import Path
6
7
@@ -9,11 +10,7 @@ def test_load_example() -> None:
9
10
cwd = Path.cwd()
11
parent = Path(__file__).resolve().parent
12
os.chdir(parent.parent)
- exec(
13
- open(parent / "load_cwl_by_path.py").read(),
14
- globals(),
15
- locals(),
16
- )
+ result_raw = runpy.run_path(str(parent / "load_cwl_by_path.py"))
17
os.chdir(cwd)
18
- result = locals()["saved_obj"]
+ result = result_raw["saved_obj"]
19
assert result["class"] == "Workflow"
0 commit comments