Skip to content

Commit 02c48e9

Browse files
Fixes failing test on python 3.13 and ensure macOS uses 3.12 (#87)
Co-authored-by: Alex H. Room <[email protected]>
1 parent 39a5b76 commit 02c48e9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-latest, windows-latest, macos-13]
23-
version: ["3.9", "3.12"]
23+
version: ["3.9", "3.13"]
2424
defaults:
2525
run:
2626
shell: bash -l {0}
@@ -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)