@@ -23,14 +23,14 @@ def test_repo_git_obtain_initial_commit_repo(tmp_path: pathlib.Path):
23
23
"""
24
24
repo_name = "my_git_project"
25
25
26
- run (["git" , "init" , repo_name ], cwd = str ( tmp_path ) )
26
+ run (["git" , "init" , repo_name ], cwd = tmp_path )
27
27
28
28
bare_repo_dir = tmp_path / repo_name
29
29
30
30
git_repo = create_repo_from_pip_url (
31
31
** {
32
- "pip_url" : "git+file://" + str ( bare_repo_dir ) ,
33
- "repo_dir" : str ( tmp_path / "obtaining a bare repo" ) ,
32
+ "pip_url" : f "git+file://{ bare_repo_dir } " ,
33
+ "repo_dir" : tmp_path / "obtaining a bare repo" ,
34
34
}
35
35
)
36
36
@@ -41,8 +41,8 @@ def test_repo_git_obtain_initial_commit_repo(tmp_path: pathlib.Path):
41
41
def test_repo_git_obtain_full (tmp_path : pathlib .Path , git_remote ):
42
42
git_repo = create_repo_from_pip_url (
43
43
** {
44
- "pip_url" : "git+file://" + git_remote ,
45
- "repo_dir" : str ( tmp_path / "myrepo" ) ,
44
+ "pip_url" : f "git+file://{ git_remote } " ,
45
+ "repo_dir" : tmp_path / "myrepo" ,
46
46
}
47
47
)
48
48
@@ -51,14 +51,14 @@ def test_repo_git_obtain_full(tmp_path: pathlib.Path, git_remote):
51
51
test_repo_revision = run (["git" , "rev-parse" , "HEAD" ], cwd = git_remote )
52
52
53
53
assert git_repo .get_revision () == test_repo_revision
54
- assert os .path .exists (str ( tmp_path / "myrepo" ) )
54
+ assert os .path .exists (tmp_path / "myrepo" )
55
55
56
56
57
57
def test_repo_update_handle_cases (tmp_path : pathlib .Path , git_remote , mocker ):
58
58
git_repo = create_repo_from_pip_url (
59
59
** {
60
- "pip_url" : "git+file://" + git_remote ,
61
- "repo_dir" : str ( tmp_path / "myrepo" ) ,
60
+ "pip_url" : f "git+file://{ git_remote } " ,
61
+ "repo_dir" : tmp_path / "myrepo" ,
62
62
}
63
63
)
64
64
@@ -90,8 +90,8 @@ def progress_callback_spy(output, timestamp):
90
90
# create a new repo with the repo as a remote
91
91
git_repo = create_repo_from_pip_url (
92
92
** {
93
- "pip_url" : "git+file://" + git_remote ,
94
- "repo_dir" : str ( tmp_path / "myrepo" ) ,
93
+ "pip_url" : f "git+file://{ git_remote } " ,
94
+ "repo_dir" : tmp_path / "myrepo" ,
95
95
"progress_callback" : progress_callback ,
96
96
}
97
97
)
@@ -107,7 +107,7 @@ def test_remotes(parentdir, git_remote):
107
107
108
108
git_repo = create_repo_from_pip_url (
109
109
pip_url = f"git+file://{ git_remote } " ,
110
- repo_dir = os . path . join ( str ( parentdir ), repo_name ) ,
110
+ repo_dir = parentdir / repo_name ,
111
111
)
112
112
git_repo .obtain ()
113
113
git_repo .set_remote (name = remote_name , url = remote_url )
@@ -141,7 +141,7 @@ def test_git_get_url_and_rev_from_pip_url():
141
141
def test_remotes_preserves_git_ssh (parentdir , git_remote ):
142
142
# Regression test for #14
143
143
repo_name = "myexamplegit"
144
- repo_dir = os . path . join ( str ( parentdir ), repo_name )
144
+ repo_dir = parentdir / repo_name
145
145
remote_name = "myremote"
146
146
remote_url = "git+ssh://git@github.com/tony/AlgoXY.git"
147
147
@@ -160,7 +160,7 @@ def test_remotes_preserves_git_ssh(parentdir, git_remote):
160
160
161
161
def test_private_ssh_format (pip_url_kwargs ):
162
162
pip_url_kwargs .update (
163
- ** {"pip_url" : "git+ssh://github.com:" + " /tmp/omg/private_ssh_repo" }
163
+ ** {"pip_url" : "git+ssh://github.com:/tmp/omg/private_ssh_repo" }
164
164
)
165
165
166
166
with pytest .raises (exc .LibVCSException ) as excinfo :
@@ -224,7 +224,7 @@ def test_get_current_remote_name(git_repo):
224
224
225
225
new_remote_name = "new_remote_name"
226
226
git_repo .set_remote (
227
- name = new_remote_name , url = "file://" + git_repo .path , overwrite = True
227
+ name = new_remote_name , url = f "file://{ git_repo .path } " , overwrite = True
228
228
)
229
229
git_repo .run (["fetch" , new_remote_name ])
230
230
git_repo .run (["branch" , "--set-upstream-to" , f"{ new_remote_name } /{ new_branch } " ])
0 commit comments