diff options
Diffstat (limited to 'setuptools/tests/test_virtualenv.py')
| -rw-r--r-- | setuptools/tests/test_virtualenv.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py index eb8db7a6..a7f485a4 100644 --- a/setuptools/tests/test_virtualenv.py +++ b/setuptools/tests/test_virtualenv.py @@ -1,3 +1,4 @@ +import glob import os from pytest import yield_fixture @@ -29,3 +30,21 @@ def test_clean_env_install(bare_virtualenv): 'cd {source}', 'python setup.py install', )).format(source=SOURCE_DIR)) + +def test_pip_upgrade_from_source(virtualenv): + """ + Check pip can upgrade setuptools from source. + """ + dist_dir = virtualenv.workspace + # Generate source distribution / wheel. + virtualenv.run(' && '.join(( + 'cd {source}', + 'python setup.py -q sdist -d {dist}', + 'python setup.py -q bdist_wheel -d {dist}', + )).format(source=SOURCE_DIR, dist=dist_dir)) + sdist = glob.glob(os.path.join(dist_dir, '*.zip'))[0] + wheel = glob.glob(os.path.join(dist_dir, '*.whl'))[0] + # Then update from wheel. + virtualenv.run('pip install ' + wheel) + # And finally try to upgrade from source. + virtualenv.run('pip install --no-cache-dir --upgrade ' + sdist) |
