Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 9, 2024
1 parent aa02b78 commit cdb7ebd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import pytest
import requests
from requests import Response

from dvc_studio_client.auth import (
AuthorizationExpiredError,
InvalidScopesError,
check_token_authentication,
get_access_token,
start_device_login,
)
from requests import Response

MOCK_RESPONSE = {
"verification_uri": "https://studio.example.com/auth/device-login",
Expand All @@ -18,7 +19,7 @@
}


@pytest.fixture()
@pytest.fixture
def mock_response(mocker):
def _mock_response(status_code, json):
response = Response()
Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions tests/test_model_registry.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion tests/test_post_live_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand Down

0 comments on commit cdb7ebd

Please sign in to comment.