mirror of https://github.com/Textualize/rich.git
disabled progress does not start live
This commit is contained in:
parent
c354260e6b
commit
9e397a13db
|
@ -634,7 +634,8 @@ class Progress(JupyterMixin):
|
|||
|
||||
def start(self) -> None:
|
||||
"""Start the progress display."""
|
||||
self.live.start(refresh=True)
|
||||
if not self.disable:
|
||||
self.live.start(refresh=True)
|
||||
|
||||
def stop(self) -> None:
|
||||
"""Stop the progress display."""
|
||||
|
|
|
@ -434,6 +434,20 @@ def test_progress_max_refresh() -> None:
|
|||
)
|
||||
|
||||
|
||||
def test_live_is_started_if_progress_is_enabled() -> None:
|
||||
progress = Progress(auto_refresh=False, disable=False)
|
||||
|
||||
with progress:
|
||||
assert progress.live._started
|
||||
|
||||
|
||||
def test_live_is_not_started_if_progress_is_disabled() -> None:
|
||||
progress = Progress(auto_refresh=False, disable=True)
|
||||
|
||||
with progress:
|
||||
assert not progress.live._started
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
_render = render_progress()
|
||||
print(_render)
|
||||
|
|
Loading…
Reference in New Issue