diff --git a/tests/test_auth.py b/tests/test_auth.py index 4460110..f65b64a 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,5 +1,7 @@ import pytest import requests +from requests import Response + from dvc_studio_client.auth import ( AuthorizationExpiredError, InvalidScopesError, @@ -7,7 +9,6 @@ get_access_token, start_device_login, ) -from requests import Response MOCK_RESPONSE = { "verification_uri": "https://studio.example.com/auth/device-login", @@ -18,7 +19,7 @@ } -@pytest.fixture() +@pytest.fixture def mock_response(mocker): def _mock_response(status_code, json): response = Response() @@ -29,7 +30,7 @@ def _mock_response(status_code, json): return _mock_response -@pytest.fixture() +@pytest.fixture def mock_post(mocker, mock_response): def _mock_post(method, side_effect): return mocker.patch( diff --git a/tests/test_config.py b/tests/test_config.py index a1a26a7..3fbedfd 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -2,6 +2,7 @@ import pytest from dulwich.porcelain import clone, init + from dvc_studio_client import DEFAULT_STUDIO_URL from dvc_studio_client.config import _get_remote_url, get_studio_config from dvc_studio_client.env import ( diff --git a/tests/test_model_registry.py b/tests/test_model_registry.py index cf863c7..6738012 100644 --- a/tests/test_model_registry.py +++ b/tests/test_model_registry.py @@ -1,4 +1,5 @@ import pytest + from dvc_studio_client.env import DVC_STUDIO_TOKEN, DVC_STUDIO_URL from dvc_studio_client.model_registry import get_download_uris diff --git a/tests/test_post_live_metrics.py b/tests/test_post_live_metrics.py index 70e49bb..e4fc31e 100644 --- a/tests/test_post_live_metrics.py +++ b/tests/test_post_live_metrics.py @@ -3,6 +3,8 @@ from unittest.mock import DEFAULT, MagicMock import pytest +from requests import RequestException + from dvc_studio_client import DEFAULT_STUDIO_URL from dvc_studio_client.env import ( DVC_STUDIO_REPO_URL, @@ -16,7 +18,6 @@ get_studio_token_and_repo_url, post_live_metrics, ) -from requests import RequestException def test_post_live_metrics_skip_on_missing_token(caplog):