From 8d418c71e17f08dc7537b52209a875c2e52555b3 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Wed, 10 Jan 2018 22:27:49 +0900 Subject: tests/cachekey/cachekey.py: Manually create a symlink for our tests This works around an inconsistent behavior with setuptools. Newer versions of setuptools fail to preserve symbolic links when creating a source distribution, meaning that tests run from the dist tarball will fail. --- tests/cachekey/cachekey.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py index d59a15529..36562fbf3 100644 --- a/tests/cachekey/cachekey.py +++ b/tests/cachekey/cachekey.py @@ -150,6 +150,16 @@ DATA_DIR = os.path.join( @pytest.mark.datafiles(DATA_DIR) def test_cache_key(datafiles, cli): project = os.path.join(datafiles.dirname, datafiles.basename) + + # Workaround bug in recent versions of setuptools: newer + # versions of setuptools fail to preserve symbolic links + # when creating a source distribution, causing this test + # to fail from a dist tarball. + goodbye_link = os.path.join(project, 'files', 'local', + 'usr', 'bin', 'goodbye') + os.unlink(goodbye_link) + os.symlink('hello', goodbye_link) + result = cli.run(project=project, silent=True, args=[ 'show', '--format', '%{name}::%{full-key}', -- cgit v1.2.1