mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
'need more fixtures'
This commit is contained in:
parent
28ec6ea977
commit
2c6fb2e6f7
3 changed files with 8 additions and 9 deletions
|
@ -2,6 +2,7 @@ tools.py
|
|||
--------
|
||||
- maybe make stub Execer a fixture
|
||||
for (text_execer, test_ast, test_context)
|
||||
- decouple check_exec, check_eval, check_parse from xonsh_env
|
||||
|
||||
test_tools.py
|
||||
-------------
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
"""Tests xonsh contexts."""
|
||||
from tools import (mock_xonsh_env, execer_setup, check_exec, check_eval,
|
||||
check_parse)
|
||||
|
||||
from tools import (execer_setup, check_exec, check_eval, check_parse)
|
||||
from xonsh.contexts import Block, Functor
|
||||
|
||||
#
|
||||
|
|
|
@ -75,12 +75,12 @@ def execer_setup():
|
|||
if EXECER is None:
|
||||
EXECER = Execer(debug_level=DEBUG_LEVEL, login=False)
|
||||
|
||||
def check_exec(input, **kwargs):
|
||||
with mock_xonsh_env(None):
|
||||
if not input.endswith('\n'):
|
||||
input += '\n'
|
||||
EXECER.debug_level = DEBUG_LEVEL
|
||||
EXECER.exec(input, **kwargs)
|
||||
def check_exec(input, xonsh_env, **kwargs):
|
||||
# with mock_xonsh_env(None):
|
||||
if not input.endswith('\n'):
|
||||
input += '\n'
|
||||
EXECER.debug_level = DEBUG_LEVEL
|
||||
EXECER.exec(input, **kwargs)
|
||||
|
||||
def check_eval(input):
|
||||
env = {'AUTO_CD': False, 'XONSH_ENCODING' :'utf-8',
|
||||
|
|
Loading…
Add table
Reference in a new issue