Skip to content

Commit

Permalink
Update code for Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Aug 10, 2023
1 parent b8d4d6d commit e771640
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/disabled_parking.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pylint: disable=W0621
"""Asynchronous Python client providing Open Data information of Stockholm."""
from __future__ import annotations

import asyncio

Expand Down
9 changes: 6 additions & 3 deletions src/odp_stockholm/odp_stockholm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import socket
from dataclasses import dataclass
from importlib import metadata
from typing import Any, cast
from typing import TYPE_CHECKING, Any, cast

import async_timeout
from aiohttp import ClientError, ClientSession
Expand All @@ -15,6 +15,9 @@
from .exceptions import ODPStockholmConnectionError, ODPStockholmError
from .models import DisabledParking

if TYPE_CHECKING:
from typing_extensions import Self


@dataclass
class ParkingStockholm:
Expand Down Expand Up @@ -130,7 +133,7 @@ async def close(self) -> None:
if self.session and self._close_session:
await self.session.close()

async def __aenter__(self) -> ParkingStockholm:
async def __aenter__(self) -> Self:
"""Async enter.
Returns
Expand All @@ -139,7 +142,7 @@ async def __aenter__(self) -> ParkingStockholm:
"""
return self

async def __aexit__(self, *_exc_info: str) -> None:
async def __aexit__(self, *_exc_info: object) -> None:
"""Async exit.
Args:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Test the models for ODP Stockholm."""
from __future__ import annotations

from aiohttp import ClientSession
from aresponses import ResponsesMockServer

Expand Down

0 comments on commit e771640

Please sign in to comment.