Forward the internal handle name wrapped in rich.progress._Reader

This commit is contained in:
Martin Larralde 2022-05-05 12:25:32 +02:00
parent 79a41db38f
commit ca94962307
2 changed files with 6 additions and 0 deletions

View file

@ -600,6 +600,7 @@ def test_open_text_mode() -> None:
try:
with rich.progress.open(filename, "r") as f:
assert f.read() == "Hello, World!"
assert f.name == filename
assert f.closed
finally:
os.remove(filename)
@ -613,6 +614,7 @@ def test_wrap_file() -> None:
with open(filename, "rb") as file:
with rich.progress.wrap_file(file, total=total) as f:
assert f.read() == b"Hello, World!"
assert f.name == filename
assert f.closed
assert not f.handle.closed
assert not file.closed