From 997f97fcf456e9f63664e356e5ed2838e33d4cba Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 6 Mar 2015 15:53:13 -0500 Subject: Extract method for common behavior. --- setuptools/tests/test_easy_install.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'setuptools') 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') -- cgit v1.2.3