tests: remove use of mocker as context-manager (#3480)

This commit is contained in:
Saugat Pachhai
2020-03-16 08:25:22 +05:45
committed by GitHub
parent e69b44d1ed
commit d2734dfe1e
4 changed files with 40 additions and 43 deletions
+3 -3
View File
@@ -79,9 +79,9 @@ def test_ls_repo_with_color(tmp_dir, dvc, scm, mocker, monkeypatch, caplog):
cmd = cli_args.func(cli_args)
caplog.clear()
with mocker.patch("sys.stdout.isatty", return_value=True):
with caplog.at_level(logging.INFO, logger="dvc.command.ls"):
assert cmd.run() == 0
mocker.patch("sys.stdout.isatty", return_value=True)
with caplog.at_level(logging.INFO, logger="dvc.command.ls"):
assert cmd.run() == 0
assert caplog.records[-1].msg == "\n".join(
[