From ee35a3bc57eff16c82da1344f4d10b3525f37b82 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 20:05:43 +0545 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#180) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- tests/test_auth.py | 7 ++++--- tests/test_config.py | 1 + tests/test_model_registry.py | 1 + tests/test_post_live_metrics.py | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 479fce6..bb28896 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: sort-simple-yaml - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.5.7' + rev: 'v0.6.7' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] 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):