File tree Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 88
88
# run test suite
89
89
# ----------------------------------------------
90
90
- name : Run tests
91
+ if : matrix.os != 'windows-latest'
91
92
run : |
92
93
source $VENV
93
94
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"
Original file line number Diff line number Diff line change 9
9
10
10
11
11
@pytest .fixture (scope = "session" )
12
- @pytest .mark .skipif (
13
- platform .system () == "Windows" , reason = "Docker tests skipped on Windows"
14
- )
12
+ @pytest .mark .docker_required
15
13
def docker_postgres ():
16
14
"""Start a PostgreSQL container for testing."""
17
15
container_name = "test_postgres_container"
@@ -61,6 +59,7 @@ def docker_postgres():
61
59
62
60
63
61
@pytest .fixture (scope = "session" )
62
+ @pytest .mark .docker_required
64
63
def db_engine (docker_postgres ):
65
64
"""Create a database engine connected to the Docker PostgreSQL instance."""
66
65
engine = create_engine (docker_postgres )
@@ -98,6 +97,7 @@ def db_engine(docker_postgres):
98
97
99
98
100
99
@pytest .fixture
100
+ @pytest .mark .docker_required
101
101
def db_session (db_engine ):
102
102
"""Create a new database session for a test."""
103
103
with Session (db_engine ) as session :
@@ -106,6 +106,7 @@ def db_session(db_engine):
106
106
107
107
108
108
@pytest .fixture (scope = "function" , autouse = True )
109
+ @pytest .mark .docker_required
109
110
def reset_db (db_engine ):
110
111
SQLModel .metadata .drop_all (db_engine )
111
112
SQLModel .metadata .create_all (db_engine )
Original file line number Diff line number Diff line change 1
1
import math
2
- import platform
3
2
4
3
import pytest
5
4
6
5
from pypsdm .db .weather .models import Coordinate
7
6
from pypsdm .db .weather .utils import weighted_interpolation_coordinates
8
7
9
8
10
- @pytest .mark .skipif (
11
- platform .system () == "Windows" , reason = "Docker tests skipped on Windows"
12
- )
9
+ @pytest .mark .docker_required
13
10
def test_weighted_interpolation_coordinates (db_session ):
14
11
"""Test weighted interpolation of coordinates."""
15
12
coordinates = [
Original file line number Diff line number Diff line change 1
- import platform
2
1
from datetime import datetime
3
2
4
3
import pytest
7
6
from pypsdm .db .weather .models import Coordinate , WeatherValue
8
7
9
8
10
- @pytest .mark .skipif (
11
- platform .system () == "Windows" , reason = "Docker tests skipped on Windows"
12
- )
9
+ @pytest .mark .docker_required
13
10
def test_create_coordinate (db_session ):
14
11
"""Test creating a coordinate."""
15
12
coordinates = []
You can’t perform that action at this time.
0 commit comments