aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/contexts.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-01 23:47:12 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-01 23:47:12 -0500
commitbb7a25abe65fba3fa3e8ae3973321f1fedab8e37 (patch)
tree031ee2eb68fb43e29f1f4d1e110f24285315654a /setuptools/tests/contexts.py
parent0b799319a7360bbf2497c037188217334346ba39 (diff)
downloadexternal_python_setuptools-bb7a25abe65fba3fa3e8ae3973321f1fedab8e37.tar.gz
external_python_setuptools-bb7a25abe65fba3fa3e8ae3973321f1fedab8e37.tar.bz2
external_python_setuptools-bb7a25abe65fba3fa3e8ae3973321f1fedab8e37.zip
Also save the ENABLE_USER_SITE setting in the user_override.
Diffstat (limited to 'setuptools/tests/contexts.py')
-rw-r--r--setuptools/tests/contexts.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/setuptools/tests/contexts.py b/setuptools/tests/contexts.py
index a9626ae6..1620bdb3 100644
--- a/setuptools/tests/contexts.py
+++ b/setuptools/tests/contexts.py
@@ -3,6 +3,7 @@ import os
import shutil
import sys
import contextlib
+import site
from ..compat import StringIO
@@ -57,3 +58,12 @@ def quiet():
new_stderr.seek(0)
sys.stdout = old_stdout
sys.stderr = old_stderr
+
+
+@contextlib.contextmanager
+def save_user_site_setting():
+ saved = site.ENABLE_USER_SITE
+ try:
+ yield saved
+ finally:
+ site.ENABLE_USER_SITE = saved