Skip to content

Commit 2f21e9a

Browse files
[docker] Fix Container.attach() return type
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
1 parent 2e4013b commit 2f21e9a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from __future__ import annotations
22

3-
from docker.models.containers import Container
3+
from typing_extensions import assert_type
44

5+
from docker.models.containers import Container
56

6-
def check_attach_stream(c: Container) -> None:
7-
for line in c.attach(stdout=True, stderr=True, stream=True, logs=True):
8-
line.decode("utf-8")
7+
c: Container
8+
assert_type(c.attach(), bytes)
9+
assert_type(c.attach(stream=False), bytes)
10+
for line in c.attach(stream=True):
11+
assert_type(line, bytes)

0 commit comments

Comments
 (0)