Skip to content

Commit

Permalink
Add Python 3.11 to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswhitfield committed Oct 26, 2022
1 parent 40e9e79 commit b647789
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conda_env/environment_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- psutil
- mpi4py
- openmpi
- dask=2022.9.2
- dask=2022.10.0
- dakota
- coverage!=6.3
- flask=2.2.2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- pylint=2.15.3
- bandit=1.7.4
- codespell=2.2.1
- dask=2022.9.2
- dask=2022.10.0
- pytest
- flask=2.2.2
- configobj
3 changes: 3 additions & 0 deletions .github/workflows/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
- os: ubuntu-latest
python-version: "3.10"
conda_env: 'linux'
- os: ubuntu-latest
python-version: "3.11"
conda_env: 'minimal'
- os: macos-latest
python-version: 3.9
conda_env: 'macos'
Expand Down
16 changes: 11 additions & 5 deletions tests/new/test_bad_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,13 @@ def test_assign_protected_attribute(tmpdir):
with open(str(tmpdir.join('sim.log')), 'r') as f:
lines = f.readlines()

# python 3.10 includes the attribute name in the error message
assert "AttributeError: can't set attribute\n" in lines or "AttributeError: can't set attribute 'args'\n" in lines
assert "Exception: can't set attribute\n" in lines or "Exception: can't set attribute 'args'\n" in lines
# python 3.10 and 3.11 have different AttributeError messages
assert ("AttributeError: can't set attribute\n" in lines or
"AttributeError: can't set attribute 'args'\n" in lines or
"AttributeError: property 'args' of 'assign_protected_attribute' object has no setter\n" in lines)
assert ("Exception: can't set attribute\n" in lines or
"Exception: can't set attribute 'args'\n" in lines or
"Exception: property 'args' of 'assign_protected_attribute' object has no setter\n" in lines)

# remove timestamp
lines = [line[24:] for line in lines]
Expand All @@ -238,9 +242,11 @@ def test_assign_protected_attribute(tmpdir):
assert worker_call_end_event["code"] == "DRIVER__driver"
assert worker_call_end_event["eventtype"] == "IPS_CALL_END"
assert not worker_call_end_event['ok']
# python 3.10 includes the attribute name in the error message
# python 3.10 and 3.11 have different error messages
assert worker_call_end_event["comment"] in ("Error: \"can't set attribute\" Target = test@assign_protected_attribute@2:step(0)",
"Error: \"can't set attribute 'args'\" Target = test@assign_protected_attribute@2:step(0)")
"Error: \"can't set attribute 'args'\" Target = test@assign_protected_attribute@2:step(0)",
"Error: \"property 'args' of 'assign_protected_attribute' object has no setter\" "
"Target = test@assign_protected_attribute@2:step(0)")

sim_end_event = events[10]
assert sim_end_event["code"] == "Framework"
Expand Down

0 comments on commit b647789

Please sign in to comment.