diff options
author | Benoit Pierre <benoit.pierre@gmail.com> | 2017-09-06 21:21:54 +0200 |
---|---|---|
committer | Benoit Pierre <benoit.pierre@gmail.com> | 2017-09-06 21:26:35 +0200 |
commit | 285f48c23484f931c8418aad70d904c21061c14a (patch) | |
tree | bcaa3d6eb62c12c860700fae5e3525bc000a1fbf | |
parent | 18c23373216a57bd0301a07601120aecd95906f4 (diff) | |
download | pytest-runner-285f48c23484f931c8418aad70d904c21061c14a.tar.gz |
fix support for `dependency_links`
-rw-r--r-- | ptr.py | 5 | ||||
-rw-r--r-- | tests/test_ptr.py | 14 |
2 files changed, 17 insertions, 2 deletions
@@ -173,7 +173,10 @@ class PyTest(orig.test): dist = CustomizedDist() for attr in 'allow_hosts index_url'.split(): setattr(dist, attr, getattr(self, attr)) - for attr in 'install_requires tests_require extras_require'.split(): + for attr in ( + 'dependency_links install_requires ' + 'tests_require extras_require ' + ).split(): setattr(dist, attr, getattr(self.distribution, attr)) installed_dists = self.install_dists(dist) if self.dry_run: diff --git a/tests/test_ptr.py b/tests/test_ptr.py index aeb0f8d..521c59a 100644 --- a/tests/test_ptr.py +++ b/tests/test_ptr.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import contextlib import io import os +import shutil import sys import tarfile import textwrap @@ -101,6 +102,13 @@ def test_egg_fetcher(venv, setuptools_req, test_args): </body></html> ''' ).format(dist_sdist=dist_sdist)) + # Move barbazquux1 out of the index. + shutil.move(index_dir / 'barbazquux1', venv.workspace) + barbazquux1_link = ( + 'file://' + str(venv.workspace.abspath()) + + '/barbazquux1/barbazquux1-0.1.tar.gz' + + '#egg=barbazquux1-0.1' + ) # Prepare fake project. project_dir = (venv.workspace / 'project-0.1').mkdir() with open(project_dir / 'setup.py', 'w') as fp: @@ -110,6 +118,9 @@ def test_egg_fetcher(venv, setuptools_req, test_args): setup( name='project', version='0.1', + dependency_links = [ + {barbazquux1_link!r}, + ], setup_requires=[ 'pytest-runner', ], @@ -126,7 +137,8 @@ def test_egg_fetcher(venv, setuptools_req, test_args): 'extra': 'barbazquux5', }} ) - ''').format(sys_platform=sys.platform)) + ''').format(sys_platform=sys.platform, + barbazquux1_link=barbazquux1_link)) with open(project_dir / 'setup.cfg', 'w') as fp: fp.write(DALS( ''' |