tests: use mocker

This commit is contained in:
Saugat Pachhai (सौगात)
2022-11-03 23:07:28 +05:45
committed by skshetry
parent c27005a8b7
commit 4d17c171f1
11 changed files with 84 additions and 97 deletions
+3 -3
View File
@@ -1,6 +1,5 @@
import json
import platform
from unittest import mock
import pytest
from voluptuous import Any, Schema
@@ -57,8 +56,9 @@ def test_runtime_info(tmp_global_dir):
assert schema(analytics._runtime_info())
@mock.patch("requests.post")
def test_send(mock_post, tmp_path):
def test_send(mocker, tmp_path):
mock_post = mocker.patch("requests.post")
import requests
url = "https://analytics.dvc.org"