diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml index 883691c..2790fe7 100644 --- a/.github/workflows/pre-commit-update.yml +++ b/.github/workflows/pre-commit-update.yml @@ -2,7 +2,7 @@ name: Pre-commit auto-update on: schedule: # Run on fridays - - cron: "0 0 * * 5" + - cron: "0 0 * * 1" jobs: auto-update: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69e9e5f..1520434 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.0 + rev: v0.6.1 hooks: - id: ruff args: diff --git a/requirements-test.txt b/requirements-test.txt index f9face7..88fff4b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -6,5 +6,5 @@ pytest-cov==5.0.0 pytest-error-for-skips==2.0.2 pytest-timeout==2.3.1 pytest==8.3.2 -ruff==0.5.7 +ruff==0.6.1 syrupy==4.6.1 diff --git a/tests/conftest.py b/tests/conftest.py index 9f3ac74..c4dada3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,77 +10,77 @@ from syrupy.location import PyTestLocation -@pytest.fixture() +@pytest.fixture def stations() -> list[dict[str, Any]]: """Return stations data from the fixture file.""" with open("tests/fixtures/stations.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def station() -> list[dict[str, Any]]: """Return the station data from the fixture file.""" with open("tests/fixtures/station.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def indexes() -> dict[str, Any]: """Return indexes data from the fixture file.""" with open("tests/fixtures/indexes.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def sensor_658() -> dict[str, Any]: """Return sensor 658 data from the fixture file.""" with open("tests/fixtures/sensor_658.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def sensor_660() -> dict[str, Any]: """Return sensor 660 data from the fixture file.""" with open("tests/fixtures/sensor_660.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def sensor_665() -> dict[str, Any]: """Return sensor 665 data from the fixture file.""" with open("tests/fixtures/sensor_665.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def sensor_667() -> dict[str, Any]: """Return sensor 667 data from the fixture file.""" with open("tests/fixtures/sensor_667.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def sensor_670() -> dict[str, Any]: """Return sensor 670 data from the fixture file.""" with open("tests/fixtures/sensor_670.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def sensor_672() -> dict[str, Any]: """Return sensor 672 data from the fixture file.""" with open("tests/fixtures/sensor_672.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def sensor_14395() -> dict[str, Any]: """Return sensor 14395 data from the fixture file.""" with open("tests/fixtures/sensor_14395.json", encoding="utf-8") as file: return json.load(file) -@pytest.fixture() +@pytest.fixture def snapshot(snapshot: SnapshotAssertion) -> SnapshotAssertion: """Return snapshot assertion fixture.""" return snapshot.use_extension(SnapshotExtension) diff --git a/tests/test_init.py b/tests/test_init.py index 21c7a92..0e1c9aa 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -17,7 +17,7 @@ VALID_LONGITUDE = 88.88 -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_valid_data_first_value( snapshot: SnapshotAssertion, stations: list[dict[str, Any]], @@ -88,7 +88,7 @@ async def test_valid_data_first_value( assert data == snapshot -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_api_error() -> None: """Test GIOS API error.""" session = aiohttp.ClientSession() @@ -108,7 +108,7 @@ async def test_api_error() -> None: await session.close() -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_valid_data_second_value( snapshot: SnapshotAssertion, stations: list[dict[str, Any]], @@ -187,7 +187,7 @@ async def test_valid_data_second_value( assert data == snapshot -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_no_indexes_data( snapshot: SnapshotAssertion, stations: list[dict[str, Any]], @@ -257,7 +257,7 @@ async def test_no_indexes_data( assert data == snapshot -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_no_sensor_data_1( stations: list[dict[str, Any]], station: list[dict[str, Any]], @@ -337,7 +337,7 @@ async def test_no_sensor_data_1( await session.close() -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_invalid_sensor_data_2( stations: list[dict[str, Any]], station: list[dict[str, Any]] ) -> None: @@ -389,7 +389,7 @@ async def test_invalid_sensor_data_2( await session.close() -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_no_station_data(stations: list[dict[str, Any]]) -> None: """Test with no station data.""" session = aiohttp.ClientSession() @@ -411,7 +411,7 @@ async def test_no_station_data(stations: list[dict[str, Any]]) -> None: await session.close() -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_no_stations_data() -> None: """Test with no stations data.""" session = aiohttp.ClientSession() @@ -429,7 +429,7 @@ async def test_no_stations_data() -> None: await session.close() -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_invalid_station_id(stations: list[dict[str, Any]]) -> None: """Test with invalid station_id.""" session = aiohttp.ClientSession()