Skip to content

Commit f070890

Browse files
committed
✅ Update tests with custom stream
1 parent 35426a2 commit f070890

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/test_spinner.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,10 @@ def test_spinner_redirect_force():
6363
@click.command()
6464
def cli():
6565
stdout_io = StringIO()
66-
saved_stdout = sys.stdout
67-
sys.stdout = stdout_io # redirect stdout to a string buffer
68-
spinner = click_spinner.Spinner(force=True)
66+
spinner = click_spinner.Spinner(force=True, stream=stdout_io)
6967
spinner.start()
7068
time.sleep(1) # allow time for a few spins
7169
spinner.stop()
72-
sys.stdout = saved_stdout
7370
stdout_io.flush()
7471
stdout_str = stdout_io.getvalue()
7572
assert len(stdout_str) > 0

0 commit comments

Comments
 (0)