Skip to content

Commit 14191d3

Browse files
committed
update test to better version, also py3.13 compat
1 parent cb1c379 commit 14191d3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/test_examples.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22
"""Tests of example Python scripts."""
33
import os
4+
import runpy
45
from pathlib import Path
56

67

@@ -9,11 +10,7 @@ def test_load_example() -> None:
910
cwd = Path.cwd()
1011
parent = Path(__file__).resolve().parent
1112
os.chdir(parent.parent)
12-
exec(
13-
open(parent / "load_cwl_by_path.py").read(),
14-
globals(),
15-
locals(),
16-
)
13+
result_raw = runpy.run_path(str(parent / "load_cwl_by_path.py"))
1714
os.chdir(cwd)
18-
result = locals()["saved_obj"]
15+
result = result_raw["saved_obj"]
1916
assert result["class"] == "Workflow"

0 commit comments

Comments
 (0)