Skip to content

Commit a36b112

Browse files
committed
Prefer tmp_path fixture.
1 parent f0cda0b commit a36b112

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

setuptools/tests/test_packageindex.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ def test_egg_fragment(self):
170170
assert dists[0].version == ''
171171
assert dists[1].version == vc
172172

173-
def test_download_git_with_rev(self, tmpdir, fp):
173+
def test_download_git_with_rev(self, tmp_path, fp):
174174
url = 'git+https://github.example/group/project@master#egg=foo'
175175
index = setuptools.package_index.PackageIndex()
176176

177-
expected_dir = str(tmpdir / 'project@master')
177+
expected_dir = tmp_path / 'project@master'
178178
fp.register([
179179
'git',
180180
'clone',
@@ -184,32 +184,32 @@ def test_download_git_with_rev(self, tmpdir, fp):
184184
])
185185
fp.register(['git', '-C', expected_dir, 'checkout', '--quiet', 'master'])
186186

187-
result = index.download(url, str(tmpdir))
187+
result = index.download(url, tmp_path)
188188

189-
assert result == expected_dir
189+
assert result == str(expected_dir)
190190
assert len(fp.calls) == 2
191191

192-
def test_download_git_no_rev(self, tmpdir, fp):
192+
def test_download_git_no_rev(self, tmp_path, fp):
193193
url = 'git+https://github.example/group/project#egg=foo'
194194
index = setuptools.package_index.PackageIndex()
195195

196-
expected_dir = str(tmpdir / 'project')
196+
expected_dir = tmp_path / 'project'
197197
fp.register([
198198
'git',
199199
'clone',
200200
'--quiet',
201201
'https://github.example/group/project',
202202
expected_dir,
203203
])
204-
index.download(url, str(tmpdir))
204+
index.download(url, tmp_path)
205205

206-
def test_download_svn(self, tmpdir):
206+
def test_download_svn(self, tmp_path):
207207
url = 'svn+https://svn.example/project#egg=foo'
208208
index = setuptools.package_index.PackageIndex()
209209

210210
msg = r".*SVN download is not supported.*"
211211
with pytest.raises(distutils.errors.DistutilsError, match=msg):
212-
index.download(url, str(tmpdir))
212+
index.download(url, tmp_path)
213213

214214

215215
class TestContentCheckers:

0 commit comments

Comments
 (0)