Commit 637da2c7 authored by Jason R. Coombs's avatar Jason R. Coombs

Use tmpdir in test_local_index for brevity and isolation.

parent 58c0f878
......@@ -162,18 +162,15 @@ class TestPackageIndex:
assert url == 'https://example.com/bar'
assert rev == '2995'
def test_local_index(self):
def test_local_index(self, tmpdir):
"""
local_open should be able to read an index from the file system.
"""
f = open('index.html', 'w')
index_file = tmpdir / 'index.html'
with index_file.open('w') as f:
f.write('<div>content</div>')
f.close()
try:
url = 'file:' + pathname2url(os.getcwd()) + '/'
url = 'file:' + pathname2url(str(tmpdir)) + '/'
res = setuptools.package_index.local_open(url)
finally:
os.remove('index.html')
assert 'content' in res.read()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment