Skip to content

Commit 27e4e22

Browse files
at mark and try check os again
1 parent 5b8c9a3 commit 27e4e22

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ jobs:
8888
# run test suite
8989
#----------------------------------------------
9090
- name: Run tests
91+
if: matrix.os != 'windows-latest'
9192
run: |
9293
source $VENV
9394
pytest tests/
95+
- name: Run tests (Windows - skip Docker tests)
96+
if: matrix.os == 'windows-latest'
97+
run: |
98+
source $VENV
99+
pytest tests/ -m "not docker_required"

tests/db/weather/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010

1111
@pytest.fixture(scope="session")
12-
@pytest.mark.skipif(
13-
platform.system() == "Windows", reason="Docker tests skipped on Windows"
14-
)
12+
@pytest.mark.docker_required
1513
def docker_postgres():
1614
"""Start a PostgreSQL container for testing."""
1715
container_name = "test_postgres_container"
@@ -61,6 +59,7 @@ def docker_postgres():
6159

6260

6361
@pytest.fixture(scope="session")
62+
@pytest.mark.docker_required
6463
def db_engine(docker_postgres):
6564
"""Create a database engine connected to the Docker PostgreSQL instance."""
6665
engine = create_engine(docker_postgres)
@@ -98,6 +97,7 @@ def db_engine(docker_postgres):
9897

9998

10099
@pytest.fixture
100+
@pytest.mark.docker_required
101101
def db_session(db_engine):
102102
"""Create a new database session for a test."""
103103
with Session(db_engine) as session:
@@ -106,6 +106,7 @@ def db_session(db_engine):
106106

107107

108108
@pytest.fixture(scope="function", autouse=True)
109+
@pytest.mark.docker_required
109110
def reset_db(db_engine):
110111
SQLModel.metadata.drop_all(db_engine)
111112
SQLModel.metadata.create_all(db_engine)

tests/db/weather/test_proxy.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import math
2-
import platform
32

43
import pytest
54

65
from pypsdm.db.weather.models import Coordinate
76
from pypsdm.db.weather.utils import weighted_interpolation_coordinates
87

98

10-
@pytest.mark.skipif(
11-
platform.system() == "Windows", reason="Docker tests skipped on Windows"
12-
)
9+
@pytest.mark.docker_required
1310
def test_weighted_interpolation_coordinates(db_session):
1411
"""Test weighted interpolation of coordinates."""
1512
coordinates = [

tests/db/weather/test_weather_models.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import platform
21
from datetime import datetime
32

43
import pytest
@@ -7,9 +6,7 @@
76
from pypsdm.db.weather.models import Coordinate, WeatherValue
87

98

10-
@pytest.mark.skipif(
11-
platform.system() == "Windows", reason="Docker tests skipped on Windows"
12-
)
9+
@pytest.mark.docker_required
1310
def test_create_coordinate(db_session):
1411
"""Test creating a coordinate."""
1512
coordinates = []

0 commit comments

Comments
 (0)