Skip to content

Commit 4276d99

Browse files
committed
chore: slightly better type hints
1 parent 3e29b2b commit 4276d99

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

juju/model/_idle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import logging
88
import time
99
from dataclasses import dataclass
10-
from typing import AsyncIterable
10+
from typing import AbstractSet, AsyncIterable
1111

1212
from ..client._definitions import (
1313
ApplicationStatus,
@@ -35,7 +35,7 @@ class CheckStatus:
3535
async def loop(
3636
foo: AsyncIterable[CheckStatus | None],
3737
*,
38-
apps: frozenset[str],
38+
apps: AbstractSet[str],
3939
wait_for_exact_units: int | None = None,
4040
wait_for_units: int,
4141
idle_period: float,
@@ -101,7 +101,7 @@ async def loop(
101101
def check(
102102
full_status: FullStatus,
103103
*,
104-
apps: frozenset[str],
104+
apps: AbstractSet[str],
105105
raise_on_error: bool,
106106
raise_on_blocked: bool,
107107
status: str | None,

tests/unit/test_idle_loop.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async def checks():
1919
assert await alist(
2020
loop(
2121
checks(),
22-
apps=frozenset(["a"]),
22+
apps={"a"},
2323
wait_for_units=0,
2424
idle_period=0,
2525
)
@@ -38,7 +38,7 @@ async def checks():
3838
assert await alist(
3939
loop(
4040
checks(),
41-
apps=frozenset(["u"]),
41+
apps={"u"},
4242
wait_for_units=2,
4343
idle_period=0,
4444
)
@@ -71,7 +71,7 @@ async def checks():
7171
assert await alist(
7272
loop(
7373
checks(),
74-
apps=frozenset(["u"]),
74+
apps={"u"},
7575
wait_for_units=1,
7676
wait_for_exact_units=2,
7777
idle_period=0,
@@ -92,7 +92,7 @@ async def checks():
9292
assert await alist(
9393
loop(
9494
checks(),
95-
apps=frozenset(["hexanator"]),
95+
apps={"hexanator"},
9696
wait_for_units=1,
9797
idle_period=15,
9898
)
@@ -109,7 +109,7 @@ async def checks():
109109
assert await alist(
110110
loop(
111111
checks(),
112-
apps=frozenset(["hexanator"]),
112+
apps={"hexanator"},
113113
wait_for_units=1,
114114
idle_period=15,
115115
)

0 commit comments

Comments
 (0)