'need more fixtures'

This commit is contained in:
Konstantinos Tsakiltzidis 2016-06-25 13:38:43 +03:00
parent 28ec6ea977
commit 2c6fb2e6f7
3 changed files with 8 additions and 9 deletions

View file

@ -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
-------------

View file

@ -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
#

View file

@ -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',