Skip to content

Commit 0bb9c1e

Browse files
committed
Fixes failing test on python 3.13 and ensure macOS uses 3.12
1 parent 39a5b76 commit 0bb9c1e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.github/workflows/build_wheel.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
# of local package.
6363
mkdir tmp
6464
cp -r tests tmp/tests/
65+
export PATH="$pythonLocation:$PATH"
6566
CIBW_TEST_COMMAND='cd ${pwd}/tmp && python -m pytest tests'
6667
echo "CIBW_TEST_COMMAND=${CIBW_TEST_COMMAND}" >> $GITHUB_ENV
6768
python -m pip install cibuildwheel==2.16.5

.github/workflows/run_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@ jobs:
5252
sudo apt install libomp-dev
5353
- name: Install and Test with pytest
5454
run: |
55+
export PATH="$pythonLocation:$PATH"
5556
python -m pip install -e .[Dev]
5657
pytest tests/ --cov=RATapi --cov-report=term

tests/test_project.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,8 +1122,9 @@ def test_write_script(project, request, temp_dir, input_filename: str) -> None:
11221122
assert script_path.exists()
11231123

11241124
# Test we get the project object we expect when running the script
1125-
exec(script_path.read_text())
1126-
new_project = locals()["problem"]
1125+
local_dict = {}
1126+
exec(script_path.read_text(), globals(), local_dict)
1127+
new_project = local_dict["problem"]
11271128

11281129
for class_list in RATapi.project.class_lists:
11291130
assert getattr(new_project, class_list) == getattr(test_project, class_list)

0 commit comments

Comments
 (0)