stop using gitpython in tests (#10808)

This commit is contained in:
skshetry
2025-07-21 11:59:27 +05:45
committed by GitHub
parent b4d8690799
commit 5a68e821f2
15 changed files with 40 additions and 32 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
from urllib.parse import urljoin
import pytest
from dulwich.porcelain import remote_add as git_remote_add
from requests import Response
from dvc.env import (
@@ -85,7 +86,8 @@ def test_env_to_config():
],
)
def test_get_repo_url(dvc, scm, monkeypatch, exp_git_remote, repo_url):
scm.gitpython.repo.create_remote("origin", "git@url")
git_remote_add(scm.root_dir, "origin", "git@url")
if exp_git_remote:
monkeypatch.setenv(DVC_EXP_GIT_REMOTE, exp_git_remote)
assert get_repo_url(dvc) == repo_url