Skip to content

Commit

Permalink
Remove patched_setup_context, unused.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 26, 2021
1 parent de288e0 commit b19d64f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions setuptools/tests/test_easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import pytest
from jaraco import path

from setuptools import sandbox
from setuptools.sandbox import run_setup
import setuptools.command.easy_install as ei
from setuptools.command.easy_install import (
Expand Down Expand Up @@ -345,25 +344,6 @@ def test_local_index(self, foo_package, install_target):
expected = os.path.normcase(os.path.realpath(foo_package))
assert actual == expected

@contextlib.contextmanager
def user_install_setup_context(self, *args, **kwargs):
"""
Wrap sandbox.setup_context to patch easy_install in that context to
appear as user-installed.
"""
with self.orig_context(*args, **kwargs):
import setuptools.command.easy_install as ei
ei.__file__ = site.USER_SITE
yield

def patched_setup_context(self):
self.orig_context = sandbox.setup_context

return mock.patch(
'setuptools.sandbox.setup_context',
self.user_install_setup_context,
)


@pytest.fixture
def distutils_package():
Expand Down

0 comments on commit b19d64f

Please sign in to comment.