Skip to content

Commit

Permalink
Merge pull request #82 from ISISComputingGroup/can_we_use_3_12_yet
Browse files Browse the repository at this point in the history
Are we ready for 3.12 yet?
  • Loading branch information
iangillingham-stfc authored Nov 26, 2024
2 parents 4eacc3c + 4fb04b2 commit 0884456
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/Lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@ jobs:
compare-branch: origin/main
python-ver: '3.11'
tests:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['3.10','3.11'] # ,'3.12'] # also check on 3.12 once https://github.com/bluesky/ophyd-async/pull/478 is merged.
os: [ "ubuntu-latest", "windows-latest" ]
version: ['3.10', '3.11', '3.12']
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: install requirements
run: pip install -e .[dev]
- name: run pytest
- name: run pytest (linux)
run: IBEX_BLUESKY_CORE_LOGS=/tmp/ibex_bluesky_core_logs/ python -m pytest
if: startsWith(matrix.os,'ubuntu')
- name: run pytest (windows)
run: python -m pytest
if: startsWith(matrix.os,'windows')
results:
if: ${{ always() }}
runs-on: ubuntu-latest
Expand Down
6 changes: 2 additions & 4 deletions tests/callbacks/test_write_log_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_event_prints_header_with_units_and_respects_precision_of_value_on_first
mock_file.assert_called_with(cb.filename, "a", newline="")
first_call = call(f"\n{field_name}({units})\n")
second_call = call(f"{expected_value:.{prec}f}\n")
assert mock_file().write.has_calls(first_call, second_call)
mock_file().write.assert_has_calls([first_call, second_call])
assert mock_file().write.call_count == 2


Expand All @@ -93,9 +93,7 @@ def test_event_prints_header_without_units_and_does_not_truncate_precision_if_no
cb.event(event)

mock_file.assert_called_with(cb.filename, "a", newline="")
first_call = call(f"\n{field_name}({units})\n")
second_call = call(f"{expected_value}\n")
assert mock_file().write.has_calls(first_call, second_call)
mock_file().write.assert_has_calls([call("\ntest\n"), call("1.2345\n")])
assert mock_file().write.call_count == 2


Expand Down

0 comments on commit 0884456

Please sign in to comment.