mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
Forward the internal handle name wrapped in rich.progress._Reader
This commit is contained in:
parent
79a41db38f
commit
ca94962307
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue