diff options
| author | Xavier Fernandez <xavier.fernandez@polyconseil.fr> | 2016-07-11 11:30:11 +0200 |
|---|---|---|
| committer | Xavier Fernandez <xavier.fernandez@polyconseil.fr> | 2016-07-14 09:59:51 +0200 |
| commit | 020771f5e631741de31255283aa81adc05a26a9d (patch) | |
| tree | 86bb7308b64137445b0a48335db0f174b1c53a52 /setuptools/tests/test_egg_info.py | |
| parent | d9a251b704b87e9a0e5090213e7799c468c4bbf5 (diff) | |
| download | python-setuptools-git-020771f5e631741de31255283aa81adc05a26a9d.tar.gz | |
Add basic tests and docs for python_requires
Diffstat (limited to 'setuptools/tests/test_egg_info.py')
| -rw-r--r-- | setuptools/tests/test_egg_info.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index afbda2cc..d758ff90 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -210,6 +210,30 @@ class TestEggInfo(object): 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): + self._setup_script_with_requires( + """python_requires='>=2.7.12',""") + environ = os.environ.copy().update( + HOME=env.paths['home'], + ) + code, data = environment.run_setup_py( + cmd=['egg_info'], + pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]), + data_stream=1, + env=environ, + ) + egg_info_dir = os.path.join('.', 'foo.egg-info') + pkginfo = os.path.join(egg_info_dir, 'PKG-INFO') + assert 'Requires-Python: >=2.7.12' in open(pkginfo).read().split('\n') + + def test_python_requires_install(self, tmpdir_cwd, env): + self._setup_script_with_requires( + """python_requires='>=1.2.3',""") + self._run_install_command(tmpdir_cwd, env) + egg_info_dir = self._find_egg_info_files(env.paths['lib']).base + pkginfo = os.path.join(egg_info_dir, 'PKG-INFO') + assert 'Requires-Python: >=1.2.3' in open(pkginfo).read().split('\n') + def _run_install_command(self, tmpdir_cwd, env, cmd=None, output=None): environ = os.environ.copy().update( HOME=env.paths['home'], |
