This commit is contained in:
Anthony Scopatz 2017-02-25 21:45:32 -05:00
parent c2d25d02aa
commit 4dbbcf56e8
2 changed files with 20 additions and 15 deletions

View file

@ -210,20 +210,6 @@ def test_script_stder(case):
('pwd', None, lambda: os.getcwd() + '\n'),
('echo WORKING', None, 'WORKING\n'),
('ls -f', lambda out: out.splitlines().sort(), os.listdir().sort()),
# test subshell wrapping
("""
with open('tttt', 'w') as fp:
fp.write("Wow mom!\\n")
(wc) < tttt
""", None, " 1 2 9 <stdin>\n"),
# test subshell statement wrapping
("""
with open('tttt', 'w') as fp:
fp.write("Wow mom!\\n")
(wc;) < tttt
""", None, " 1 2 9 <stdin>\n"),
])
def test_single_command_no_windows(cmd, fmt, exp):
check_run_xonsh(cmd, fmt, exp)
@ -247,6 +233,26 @@ def test_sourcefile():
check_run_xonsh('printfile.xsh', None, 'printfile.xsh\n')
@_bad_case
@pytest.mark.parametrize('cmd, fmt, exp', [
# test subshell wrapping
("""
with open('tttt', 'w') as fp:
fp.write("Wow mom!\\n")
(wc) < tttt
""", None, " 1 2 9 <stdin>\n"),
# test subshell statement wrapping
("""
with open('tttt', 'w') as fp:
fp.write("Wow mom!\\n")
(wc;) < tttt
""", None, " 1 2 9 <stdin>\n"),
])
def test_subshells(cmd, fmt, exp):
check_run_xonsh(cmd, fmt, exp)
@skip_if_on_windows
@pytest.mark.parametrize('cmd, exp', [

View file

@ -2541,7 +2541,6 @@ class BaseParser(object):
arg._cliarg_action = 'append'
p[0] = p0
#
# Subproc atom rules
#