From 8a14700c12132889eb1be1022f79088ff0dff51b Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Tue, 17 Dec 2019 12:18:43 -0600 Subject: [PATCH] tests/updater: fix problems with .check --- tests/unit/test_updater.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_updater.py b/tests/unit/test_updater.py index d68e33d0a..92dc3b037 100644 --- a/tests/unit/test_updater.py +++ b/tests/unit/test_updater.py @@ -48,10 +48,14 @@ def test_is_outdated(latest, current, result, updater): @pytest.mark.skipif( os.getenv("TRAVIS_EVENT_TYPE") != "cron", reason = "Only run on travis CRON to avoid generating too much logs" -def test_check(updater, monkeypatch): - monkeypatch.setenv("DVC_TEST", "true") - monkeypatch.delenv("CI") +) +@mock.patch("dvc.updater.Updater._check") +def test_check(mock_check, updater, monkeypatch): + monkeypatch.delenv("CI", None) + monkeypatch.setenv("DVC_TEST", False) updater.check() updater.check() updater.check() + + assert mock_check.call_count == 3