Skip to content

Commit

Permalink
test: progress.Tqdm(disable=False)
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Feb 14, 2020
1 parent bf8b5c9 commit 163fd65
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/unit/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ def test_quiet_logging(caplog, capsys):
assert out_err.err == ""


def test_quiet_logging_disable_false(caplog, capsys):
with caplog.at_level(logging.CRITICAL, logger="dvc"):
# simulate interactive terminal
with mock.patch.object(sys.stderr, "isatty", return_value=True):
for _ in Tqdm(range(10), disable=False):
pass
out_err = capsys.readouterr()
assert out_err.out == ""
assert out_err.err == ""


def test_quiet_notty(caplog, capsys):
with caplog.at_level(logging.INFO, logger="dvc"):
for _ in Tqdm(range(10)):
Expand Down

0 comments on commit 163fd65

Please sign in to comment.