diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7492898..3f7de14 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,7 +8,13 @@ on: jobs: unit: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: [3.12, 3.13] + dependency-mode: [lowest-direct, highest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install uv @@ -18,12 +24,13 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version-file: pyproject.toml + python-version: ${{ matrix.python-version }} - name: Install the project - run: uv sync --only-dev + run: uv sync --only-dev --resolution=${{ matrix.dependency-mode }} - name: Run tests id: run-tests - run: > + shell: bash + run: | uv run pytest \ --junitxml=pytest.xml \ --cov-report=term-missing:skip-covered \ diff --git a/tests/unit/test_reader.py b/tests/unit/test_reader.py index 87c23c2..16b9358 100644 --- a/tests/unit/test_reader.py +++ b/tests/unit/test_reader.py @@ -1,6 +1,7 @@ """Test cases for reader.py functions.""" import pathlib +import re import pandas as pd import pytest @@ -33,7 +34,7 @@ def test_parse_filename_valid(sample_data: pathlib.Path) -> None: ) def test_parse_filename_invalid(invalid_filename: str) -> None: """Test that invalid filenames raise a ValueError.""" - filename = invalid_filename.replace("[", "\\[").replace("]", "\\]") + filename = re.escape(invalid_filename) with pytest.raises( ValueError, match=f"Filename does not match expected pattern: {filename}", @@ -69,6 +70,6 @@ def test_load_spiral(sample_data: pathlib.Path) -> None: def test_load_spiral_invalid_extension(sample_data: pathlib.Path) -> None: """Test that loading a non-CSV file raises an error.""" invalid_file = sample_data.with_suffix(".txt") - filename = invalid_file.as_posix().replace("[", "\\[").replace("]", "\\]") + filename = re.escape(str(invalid_file)) with pytest.raises(IOError, match=f"Error reading file {filename}"): reader.load_spiral(invalid_file)