From 7068c319d9715866d6bb873252aba6d334b283a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:47:02 +0200 Subject: [PATCH] Bump ruff from 0.5.7 to 0.6.1 (#81) * Bump ruff from 0.5.7 to 0.6.1 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.5.7 to 0.6.1. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.5.7...0.6.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix lint errors * Bump ruff pre-commit hook --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Maciej Bieniek --- .pre-commit-config.yaml | 2 +- requirements-test.txt | 2 +- tests/conftest.py | 10 +++++----- tests/test_init.py | 34 +++++++++++++++++----------------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 909cfd2..ecbe20e 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 6b7d0ed..c74a35c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -7,5 +7,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 0bc9a63..f7c1724 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,21 +10,21 @@ from syrupy.location import PyTestLocation -@pytest.fixture() +@pytest.fixture def weather_stations() -> list[dict[str, Any]]: """Return weather stations data from the fixture file.""" with Path.open("tests/fixtures/weather_stations.json", encoding="utf-8") as file: return cast(list[dict[str, Any]], json.load(file)) -@pytest.fixture() +@pytest.fixture def weather_station() -> dict[str, Any]: """Return weather station data from the fixture file.""" with Path.open("tests/fixtures/weather_station.json", encoding="utf-8") as file: return cast(dict[str, Any], json.load(file)) -@pytest.fixture() +@pytest.fixture def hydrological_stations() -> list[dict[str, Any]]: """Return hydrological stations data from the fixture file.""" with Path.open( @@ -33,7 +33,7 @@ def hydrological_stations() -> list[dict[str, Any]]: return cast(list[dict[str, Any]], json.load(file)) -@pytest.fixture() +@pytest.fixture def hydrological_details() -> dict[str, Any]: """Return hydrological details from the fixture file.""" with Path.open( @@ -42,7 +42,7 @@ def hydrological_details() -> dict[str, Any]: return cast(dict[str, Any], 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 d94af03..7f5e36e 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -22,7 +22,7 @@ TEST_TIME = datetime(2024, 4, 22, 11, 10, 32, tzinfo=UTC) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_weather_stations( snapshot: SnapshotAssertion, weather_stations: list[dict[str, Any]] ) -> None: @@ -45,7 +45,7 @@ async def test_weather_stations( assert imgwpib.weather_stations == snapshot -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_weather_station( snapshot: SnapshotAssertion, weather_stations: list[dict[str, Any]], @@ -66,7 +66,7 @@ async def test_weather_station( assert weather_data == snapshot -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_wrong_weather_station_id(weather_stations: list[dict[str, Any]]) -> None: """Test wrong weather station ID.""" session = aiohttp.ClientSession() @@ -82,7 +82,7 @@ async def test_wrong_weather_station_id(weather_stations: list[dict[str, Any]]) assert str(exc_info.value) == "Invalid weather station ID: abcd1234" -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_hydrological_stations( snapshot: SnapshotAssertion, hydrological_stations: list[dict[str, Any]] ) -> None: @@ -103,7 +103,7 @@ async def test_hydrological_stations( assert imgwpib.hydrological_stations == snapshot -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_hydrological_station( snapshot: SnapshotAssertion, hydrological_stations: list[dict[str, Any]], @@ -130,7 +130,7 @@ async def test_hydrological_station( assert hydrological_data == snapshot -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_wrong_weather_hydrological_id( hydrological_stations: list[dict[str, Any]], ) -> None: @@ -148,7 +148,7 @@ async def test_wrong_weather_hydrological_id( assert str(exc_info.value) == "Invalid hydrological station ID: abcd1234" -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_api_error() -> None: """Test API error.""" session = aiohttp.ClientSession() @@ -168,7 +168,7 @@ async def test_api_error() -> None: assert str(exc.value) == "Invalid response: 400" -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_get_weather_data_without_station_id() -> None: """Test get_weather_data() without station ID.""" session = aiohttp.ClientSession() @@ -183,7 +183,7 @@ async def test_get_weather_data_without_station_id() -> None: assert str(exc.value) == "Weather station ID is not set" -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_get_hydrological_data_without_station_id() -> None: """Test get_hydrological_data() without station ID.""" session = aiohttp.ClientSession() @@ -198,7 +198,7 @@ async def test_get_hydrological_data_without_station_id() -> None: assert str(exc.value) == "Hydrological station ID is not set" -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_invalid_water_level_value( hydrological_stations: list[dict[str, Any]], hydrological_details: dict[str, Any], @@ -229,7 +229,7 @@ async def test_invalid_water_level_value( @pytest.mark.parametrize("date_time", [None, "lorem ipsum"]) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_invalid_date( hydrological_stations: list[dict[str, Any]], hydrological_details: dict[str, Any], @@ -262,7 +262,7 @@ async def test_invalid_date( ("water_level", "flood_warning_level", "expected"), [(100.0, 200.0, False), (100.0, 100.0, True), (100.0, 50.0, True)], ) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_flood_warning( hydrological_stations: list[dict[str, Any]], hydrological_details: dict[str, Any], @@ -298,7 +298,7 @@ async def test_flood_warning( ("water_level", "flood_alarm_level", "expected"), [(100.0, 200.0, False), (100.0, 100.0, True), (100.0, 50.0, True)], ) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_flood_alarm( hydrological_stations: list[dict[str, Any]], hydrological_details: dict[str, Any], @@ -330,7 +330,7 @@ async def test_flood_alarm( assert result.flood_alarm == expected -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_water_temperature_not_current( hydrological_stations: list[dict[str, Any]], hydrological_details: dict[str, Any], @@ -362,7 +362,7 @@ async def test_water_temperature_not_current( assert result.water_temperature_measurement_date is None -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_hydrological_data_invalid_content( hydrological_stations: list[dict[str, Any]], hydrological_details: dict[str, Any], @@ -389,7 +389,7 @@ async def test_hydrological_data_invalid_content( assert str(exc_info.value) == "Invalid content type: text/html" -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_no_hydrological_data( hydrological_stations: list[dict[str, Any]], hydrological_details: dict[str, Any], @@ -419,7 +419,7 @@ async def test_no_hydrological_data( assert str(exc_info.value) == "No hydrological data for station ID: 154190050" -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_hydrological_details_is_null( hydrological_stations: list[dict[str, Any]], ) -> None: