diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-01-23 19:35:27 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-01-23 19:35:27 -0500 |
| commit | 2885ca26494e6f555fae85f8f9983c2361c93829 (patch) | |
| tree | 1e21301b8f0178951321c4cdcb570b7d89c853ce /setuptools/tests | |
| parent | 4b0408a18dcda286af6668b7ef6934e53d1f247c (diff) | |
| download | python-setuptools-git-2885ca26494e6f555fae85f8f9983c2361c93829.tar.gz | |
Remove 'main' function from 'easy_install'.
Diffstat (limited to 'setuptools/tests')
| -rw-r--r-- | setuptools/tests/test_easy_install.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 3340a59c..66598066 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -15,6 +15,7 @@ import zipfile import mock import time import re +import subprocess import pytest @@ -25,7 +26,6 @@ from setuptools.command.easy_install import ( EasyInstallDeprecationWarning, ScriptWriter, PthDistributions, WindowsScriptWriter, ) -from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution from pkg_resources import normalize_path, working_set from pkg_resources import Distribution as PRDistribution @@ -461,17 +461,16 @@ class TestSetupRequires: with TestSetupRequires.create_sdist() as dist_file: with contexts.tempdir() as temp_install_dir: with contexts.environment(PYTHONPATH=temp_install_dir): - ei_params = [ + cmd = [ + sys.executable, + '-m', 'setup', + 'easy_install', '--index-url', mock_index.url, '--exclude-scripts', '--install-dir', temp_install_dir, dist_file, ] - with sandbox.save_argv(['easy_install']): - # attempt to install the dist. It should - # fail because it doesn't exist. - with pytest.raises(SystemExit): - easy_install_pkg.main(ei_params) + subprocess.Popen(cmd).wait() # there should have been one requests to the server assert [r.path for r in mock_index.requests] == ['/does-not-exist/'] |
