diff options
| author | Benoit Pierre <benoit.pierre@gmail.com> | 2017-07-10 02:54:29 +0200 |
|---|---|---|
| committer | Benoit Pierre <benoit.pierre@gmail.com> | 2017-07-13 21:25:42 +0200 |
| commit | 050808db513e54c12190d64d5ba0a1f6e8ad9590 (patch) | |
| tree | 3737ce4ec7f7b6ea948ba67bef6a001ddea623e4 /setuptools/tests | |
| parent | f8899569a5433f5d9027c294686a8b62215975c1 (diff) | |
| download | external_python_setuptools-050808db513e54c12190d64d5ba0a1f6e8ad9590.tar.gz external_python_setuptools-050808db513e54c12190d64d5ba0a1f6e8ad9590.tar.bz2 external_python_setuptools-050808db513e54c12190d64d5ba0a1f6e8ad9590.zip | |
fix handling of environment markers in `install_requires`
Diffstat (limited to 'setuptools/tests')
| -rw-r--r-- | setuptools/tests/test_egg_info.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index a32b981d..55df4489 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -185,8 +185,12 @@ class TestEggInfo(object): self._run_install_command(tmpdir_cwd, env) egg_info_dir = self._find_egg_info_files(env.paths['lib']).base requires_txt = os.path.join(egg_info_dir, 'requires.txt') - assert "barbazquux;python_version<'2'" in open( - requires_txt).read().split('\n') + with open(requires_txt) as fp: + install_requires = fp.read() + assert install_requires.lstrip() == DALS(''' + [:python_version < "2"] + barbazquux + ''') assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == [] def test_setup_requires_with_markers(self, tmpdir_cwd, env): @@ -202,10 +206,11 @@ class TestEggInfo(object): tmpdir_cwd, env, cmd=['test'], output="Ran 0 tests in") assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == [] - def test_extra_requires_with_markers(self, tmpdir_cwd, env): + def test_extras_require_with_markers(self, tmpdir_cwd, env): self._setup_script_with_requires( - """extra_requires={":python_version<'2'": ["barbazquux"]},""") - self._run_install_command(tmpdir_cwd, env) + """extras_require={"extra": ["barbazquux; python_version<'2'"]},""") + with pytest.raises(AssertionError): + self._run_install_command(tmpdir_cwd, env) assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == [] def test_python_requires_egg_info(self, tmpdir_cwd, env): |
