diff --git a/.github/workflows/Lint-and-test.yml b/.github/workflows/Lint-and-test.yml index 5495ede0..694ca70a 100644 --- a/.github/workflows/Lint-and-test.yml +++ b/.github/workflows/Lint-and-test.yml @@ -7,10 +7,12 @@ 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 @@ -18,8 +20,12 @@ jobs: 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 diff --git a/tests/callbacks/test_write_log_callback.py b/tests/callbacks/test_write_log_callback.py index 1280fc7e..ad108612 100644 --- a/tests/callbacks/test_write_log_callback.py +++ b/tests/callbacks/test_write_log_callback.py @@ -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 @@ -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