Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import AsyncGenerator from collections.abc in tests #121019

Merged
merged 3 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pylint/plugins/hass_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,12 @@ class ObsoleteImportMatch:
constant=re.compile(r"^save_json|find_paths_unserializable_data$"),
),
],
"typing_extensions": [
ObsoleteImportMatch(
reason="should be imported from collections.abc",
constant=re.compile(r"^(Async)?Generator$"),
),
],
epenet marked this conversation as resolved.
Show resolved Hide resolved
}


Expand Down
3 changes: 1 addition & 2 deletions tests/components/twitch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""Tests for the Twitch component."""

from collections.abc import AsyncIterator
from collections.abc import AsyncGenerator, AsyncIterator
from typing import Any, Generic, TypeVar

from twitchAPI.object.base import TwitchObject
from typing_extensions import AsyncGenerator

from homeassistant.components.twitch import DOMAIN
from homeassistant.core import HomeAssistant
Expand Down
2 changes: 1 addition & 1 deletion tests/components/youtube/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Tests for the YouTube integration."""

from collections.abc import AsyncGenerator
import json

from typing_extensions import AsyncGenerator
from youtubeaio.models import YouTubeChannel, YouTubePlaylistItem, YouTubeSubscription
from youtubeaio.types import AuthScope

Expand Down