From 7dc41b1b3e9769c57162728826bbe72e2e0dcbbb Mon Sep 17 00:00:00 2001 From: Lucain Date: Mon, 25 Nov 2024 18:08:35 +0100 Subject: [PATCH] Fix lint after ruff update (#2680) * Fix lint after ruff update * fixing? --- tests/test_auth_cli.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/test_auth_cli.py b/tests/test_auth_cli.py index d9013b44ff..f04cb1973a 100644 --- a/tests/test_auth_cli.py +++ b/tests/test_auth_cli.py @@ -57,10 +57,9 @@ def mock_stored_tokens(): "token2": "hf_5678", "active_token": "hf_9012", } - with patch("huggingface_hub._login.get_stored_tokens", return_value=stored_tokens), patch( - "huggingface_hub.utils._auth.get_stored_tokens", return_value=stored_tokens - ): - yield stored_tokens + with patch("huggingface_hub._login.get_stored_tokens", return_value=stored_tokens): + with patch("huggingface_hub.utils._auth.get_stored_tokens", return_value=stored_tokens): + yield stored_tokens def assert_in_logs(caplog: LogCaptureFixture, expected_output): @@ -89,10 +88,9 @@ def test_login_command_with_git(mock_whoami_api_call, caplog: LogCaptureFixture) args = type("Args", (), {"token": MOCK_TOKEN, "add_to_git_credential": True})() cmd = LoginCommand(args) - with patch("huggingface_hub._login._is_git_credential_helper_configured", return_value=True), patch( - "huggingface_hub.utils.set_git_credential" - ): - cmd.run() + with patch("huggingface_hub._login._is_git_credential_helper_configured", return_value=True): + with patch("huggingface_hub.utils.set_git_credential"): + cmd.run() assert_in_logs(caplog, "Login successful") assert_in_logs(caplog, "Your token has been saved in your configured git credential helpers")