try more attachments and fix further deps warnings

This commit is contained in:
Anthony Scopatz 2018-10-11 12:16:31 -04:00
parent 579ccd07d9
commit 2d41c591a5
3 changed files with 15 additions and 8 deletions

View file

@ -33,11 +33,19 @@ def source_path():
def ensure_attached_session(session):
builtins.__xonsh__ = session
if not hasattr(builtins, '__xonsh__'):
for i in range(1, 11):
builtins.__xonsh__ = session
if hasattr(builtins, "__xonsh__"):
break
# I have no idea why pytest fails to assign into the builtins module
# sometimes, but the following globals trick seems to work -scopatz
globals()['__builtins__']['__xonsh__'] = session
globals()["__builtins__"]["__xonsh__"] = session
if hasattr(builtins, "__xonsh__"):
break
else:
raise RuntimeError(
"Could not attach xonsh session to builtins " "after many tries!"
)
@pytest.fixture

View file

@ -65,8 +65,7 @@ def _is_unc_path(some_path) -> bool:
def _unc_map_temp_drive(unc_path) -> str:
"""Map a new temporary drive letter for each distinct share,
r"""Map a new temporary drive letter for each distinct share,
unless `CMD.EXE` is not insisting on non-UNC working directory.
Emulating behavior of `CMD.EXE` `pushd`, create a new mapped drive (starting from Z: towards A:, skipping existing
@ -110,7 +109,7 @@ def _unc_unmap_temp_drive(left_drive, cwd):
Args:
left_drive: driveletter (and colon) of working directory we just left
cwd: full path of new current working directory
"""
"""
global _unc_tempDrives

View file

@ -173,7 +173,7 @@ def DEFAULT_ENSURERS():
"AUTO_SUGGEST_IN_COMPLETIONS": (is_bool, to_bool, bool_to_str),
"BASH_COMPLETIONS": (is_env_path, str_to_env_path, env_path_to_str),
"CASE_SENSITIVE_COMPLETIONS": (is_bool, to_bool, bool_to_str),
re.compile("\w*DIRS$"): (is_env_path, str_to_env_path, env_path_to_str),
re.compile(r"\w*DIRS$"): (is_env_path, str_to_env_path, env_path_to_str),
"COLOR_INPUT": (is_bool, to_bool, bool_to_str),
"COLOR_RESULTS": (is_bool, to_bool, bool_to_str),
"COMPLETIONS_BRACKETS": (is_bool, to_bool, bool_to_str),
@ -216,7 +216,7 @@ def DEFAULT_ENSURERS():
"LOADED_RC_FILES": (is_bool_seq, csv_to_bool_seq, bool_seq_to_csv),
"MOUSE_SUPPORT": (is_bool, to_bool, bool_to_str),
"MULTILINE_PROMPT": (is_string_or_callable, ensure_string, ensure_string),
re.compile("\w*PATH$"): (is_env_path, str_to_env_path, env_path_to_str),
re.compile(r"\w*PATH$"): (is_env_path, str_to_env_path, env_path_to_str),
"PATHEXT": (
is_nonstring_seq_of_strings,
pathsep_to_upper_seq,