diff --git a/tests/func/test_checkout.py b/tests/func/test_checkout.py index bf86e917f..d08db4ac3 100644 --- a/tests/func/test_checkout.py +++ b/tests/func/test_checkout.py @@ -407,11 +407,15 @@ class TestCheckoutShouldHaveSelfClearingProgressBar(TestDvc): self._prepare_repo() def test(self): + encoding = sys.stderr.encoding with self._caplog.at_level(logging.INFO, logger="dvc"), patch.object( sys, "stderr" ) as stdout_mock: self.stdout_mock = logger.handlers[0].stream = stdout_mock + if sys.version_info[:1] < (3,): + sys.stderr.encoding = encoding + ret = main(["checkout"]) self.assertEqual(0, ret)