some windows test fixes and skips

This commit is contained in:
Anthony Scopatz 2018-12-06 13:35:43 -05:00
parent 609370d48e
commit 396dce8088
3 changed files with 10 additions and 10 deletions

View file

@ -2,10 +2,10 @@ import os
import tempfile
from xonsh.lib.os import indir, rmtree
from tools import skip_if_on_azure_pipelines
from tools import skip_if_on_windows
@skip_if_on_azure_pipelines
@skip_if_on_windows
def test_indir():
with tempfile.TemporaryDirectory() as tmpdir:
assert ![pwd].output.strip() != tmpdir

View file

@ -4,10 +4,10 @@ import tempfile
from xonsh.lib.os import indir
from xonsh.lib.subprocess import run, check_call, check_output, CalledProcessError
from tools import skip_if_on_windows, skip_if_on_azure_pipelines
from tools import skip_if_on_windows
@skip_if_on_azure_pipelines
@skip_if_on_windows
def test_run():
with tempfile.TemporaryDirectory() as tmpdir:
with indir(tmpdir):
@ -19,7 +19,7 @@ def test_run():
assert 'tst_dir/hello.txt' in g`tst_dir/*.txt`
@skip_if_on_azure_pipelines
@skip_if_on_windows
def test_check_call():
with tempfile.TemporaryDirectory() as tmpdir:
with indir(tmpdir):
@ -41,7 +41,7 @@ def test_check_call_raises():
assert got_raise
@skip_if_on_azure_pipelines
@skip_if_on_windows
def test_check_output():
with tempfile.TemporaryDirectory() as tmpdir:
with indir(tmpdir):
@ -52,4 +52,3 @@ def test_check_output():
p = check_output(['touch', 'hello.txt'], cwd='tst_dir')
assert p.decode('utf-8') == ''
assert 'tst_dir/hello.txt' in g`tst_dir/*.txt`

View file

@ -64,6 +64,7 @@ from xonsh.tools import (
is_balanced,
subexpr_before_unbalanced,
swap_values,
get_line_continuation,
get_logical_line,
replace_logical_line,
check_quotes,
@ -74,7 +75,7 @@ from xonsh.tools import (
)
from xonsh.environ import Env
from tools import skip_if_on_windows, skip_if_on_unix, skip_if_py34, skip_if_on_azure_pipelines
from tools import skip_if_on_windows, skip_if_on_unix, skip_if_py34
LEXER = Lexer()
LEXER.build()
@ -505,7 +506,6 @@ mom"""
]
@skip_if_on_azure_pipelines
@pytest.mark.parametrize("src, idx, exp_line, exp_n", LOGICAL_LINE_CASES)
def test_get_logical_line(src, idx, exp_line, exp_n):
lines = src.splitlines()
@ -522,7 +522,8 @@ def test_replace_logical_line(src, idx, exp_line, exp_n):
idx -= 1
replace_logical_line(lines, logical, idx, exp_n)
exp = src.replace("\\\n", "").strip()
obs = "\n".join(lines).replace("\\\n", "").strip()
lc = get_line_continuation() + "\n"
obs = "\n".join(lines).replace(lc, "").strip()
assert exp == obs