Commit bb7a25ab authored by Jason R. Coombs's avatar Jason R. Coombs

Also save the ENABLE_USER_SITE setting in the user_override.

parent 0b799319
......@@ -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
......@@ -13,4 +13,5 @@ def user_override():
with mock.patch('site.USER_BASE', user_base):
with contexts.tempdir() as user_site:
with mock.patch('site.USER_SITE', user_site):
yield
with contexts.save_user_site_setting():
yield
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment