Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/test_reader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test cases for reader.py functions."""

import pathlib
import re

import pandas as pd
import pytest
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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)