aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-03-06 15:53:13 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-03-06 15:53:13 -0500
commit997f97fcf456e9f63664e356e5ed2838e33d4cba (patch)
tree50bb9f114661e54b2fc06a9e9eaa3b688d2900fa
parentdc5ad278255437f54f3033e5c526d6f2d1d1f2e5 (diff)
downloadexternal_python_setuptools-997f97fcf456e9f63664e356e5ed2838e33d4cba.tar.gz
external_python_setuptools-997f97fcf456e9f63664e356e5ed2838e33d4cba.tar.bz2
external_python_setuptools-997f97fcf456e9f63664e356e5ed2838e33d4cba.zip
Extract method for common behavior.
-rw-r--r--setuptools/tests/test_easy_install.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index ec5d5faa..eed3bdb5 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -160,25 +160,23 @@ class TestUserInstallTest:
easy_install_pkg.__file__ = site.USER_SITE
site.ENABLE_USER_SITE = True
- # create a finalized easy_install command
- dist = Distribution()
- dist.script_name = 'setup.py'
- cmd = ei.easy_install(dist)
- cmd.args = ['py']
- cmd.ensure_finalized()
- assert not cmd.user, 'user should not be implied'
+ self.assert_not_user_site()
def test_user_install_not_implied_user_site_disabled(self):
# ensure user-site not enabled
site.ENABLE_USER_SITE = False
+ self.assert_not_user_site()
+
+ @staticmethod
+ def assert_not_user_site():
# create a finalized easy_install command
dist = Distribution()
dist.script_name = 'setup.py'
cmd = ei.easy_install(dist)
cmd.args = ['py']
- cmd.initialize_options()
- assert not cmd.user, 'NOT user should be implied'
+ cmd.ensure_finalized()
+ assert not cmd.user, 'user should not be implied'
def test_multiproc_atexit(self):
pytest.importorskip('multiprocessing')