Commit 50b7a002 authored by Jason R. Coombs's avatar Jason R. Coombs

Merge

parents 0c984fb5 30a15dcc
import os
import pytest
import setuptools
......@@ -23,3 +25,24 @@ def test_findall_curdir(example_source):
found = list(setuptools.findall())
expected = ['readme.txt', 'foo/bar.py']
assert found == expected
@pytest.fixture
def can_symlink(tmpdir):
"""
Skip if cannot create a symbolic link
"""
link_fn = 'link'
target_fn = 'target'
try:
os.symlink(target_fn, link_fn)
except (OSError, NotImplementedError, AttributeError):
pytest.skip("Cannot create symbolic links")
os.remove(link_fn)
def test_findall_missing_symlink(tmpdir, can_symlink):
with tmpdir.as_cwd():
os.symlink('foo', 'bar')
found = list(setuptools.findall())
assert found == []
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