diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-09-19 18:00:22 +0200 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-09-19 18:00:22 +0200 |
commit | 30a15dcce774cd9ed2a3f09644aea42fb9f1e819 (patch) | |
tree | fa6ffd7973820e19d7a7eda1b9c16b94035e2afe | |
parent | 9366bb0996cd7c8d3f77ee45f84ddd77f7ded8b7 (diff) | |
download | external_python_setuptools-30a15dcce774cd9ed2a3f09644aea42fb9f1e819.tar.gz external_python_setuptools-30a15dcce774cd9ed2a3f09644aea42fb9f1e819.tar.bz2 external_python_setuptools-30a15dcce774cd9ed2a3f09644aea42fb9f1e819.zip |
Add another test capturing issue described in http://bugs.python.org/issue12885
-rw-r--r-- | setuptools/tests/test_setuptools.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/setuptools/tests/test_setuptools.py b/setuptools/tests/test_setuptools.py index f6bec644..83c42e3e 100644 --- a/setuptools/tests/test_setuptools.py +++ b/setuptools/tests/test_setuptools.py @@ -1,3 +1,5 @@ +import os + import pytest import setuptools @@ -22,3 +24,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 == [] |