summaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
authorXavier Fernandez <xav.fernandez@gmail.com>2016-11-02 13:28:17 +0100
committerDonald Stufft <donald@stufft.io>2016-11-02 08:28:17 -0400
commit8f171cd2121d720705177725d1bbda12971c4e2f (patch)
treeacceaa8db10453aa9e3002879736af6162d188a7 /tests/functional
parentdd7df7f30340280c0fd9fca238c4ae2725d68904 (diff)
downloadpip-8f171cd2121d720705177725d1bbda12971c4e2f.tar.gz
Fix environment markers evaluation - issue #3829 (#4051)
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/test_install.py21
-rw-r--r--tests/functional/test_install_reqs.py5
2 files changed, 23 insertions, 3 deletions
diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py
index 2b4d75672..4ebc1b7b3 100644
--- a/tests/functional/test_install.py
+++ b/tests/functional/test_install.py
@@ -1140,3 +1140,24 @@ def test_install_compatible_python_requires(script):
script.pip('install', 'setuptools>24.2') # This should not be needed
res = script.pip('install', pkga_path, expect_error=True)
assert "Successfully installed pkga-0.1" in res.stdout, res
+
+
+def test_install_environment_markers(script, data):
+ # make a dummy project
+ pkga_path = script.scratch_path / 'pkga'
+ pkga_path.mkdir()
+ pkga_path.join("setup.py").write(textwrap.dedent("""
+ from setuptools import setup
+ setup(name='pkga',
+ version='0.1',
+ install_requires=[
+ 'missing_pkg; python_version=="1.0"',
+ ],
+ )
+ """))
+
+ res = script.pip('install', '--no-index', pkga_path, expect_stderr=True)
+ # missing_pkg should be ignored
+ assert ("Ignoring missing-pkg: markers 'python_version == \"1.0\"' don't "
+ "match your environment") in res.stderr, str(res)
+ assert "Successfully installed pkga-0.1" in res.stdout, str(res)
diff --git a/tests/functional/test_install_reqs.py b/tests/functional/test_install_reqs.py
index 3910446eb..53f47a34a 100644
--- a/tests/functional/test_install_reqs.py
+++ b/tests/functional/test_install_reqs.py
@@ -498,9 +498,8 @@ def test_install_unsupported_wheel_link_with_marker(script, data):
expect_stderr=True,
)
- s = "Ignoring asdf: markers %r don't match your environment" %\
- u'sys_platform == "xyz"'
- assert s in result.stderr
+ assert ("Ignoring asdf: markers 'sys_platform == \"xyz\"' don't match "
+ "your environment") in result.stderr
assert len(result.files_created) == 0