from xonsh.built_ins import reglob, pathsearch, helper, superhelper, \ ensure_list_of_strs, list_of_strs_or_callables, regexsearch, \ globsearch, expand_path, convert_macro_arg, macro_context, call_macro from xonsh.environ import Env from tools import skip_if_on_windows HOME_PATH = os.path.expanduser('~') @pytest.fixture(autouse=True) def xonsh_execer_autouse(xonsh_execer): return xonsh_execer @pytest.mark.parametrize('testfile', reglob('test_.*')) def test_reglob_tests(testfile): assert (testfile.startswith('test_')) @pytest.fixture def home_env(xonsh_builtins): """Set `__xonsh_env__ ` to a new Env instance on `xonsh_builtins`""" xonsh_builtins.__xonsh_env__ = Env(HOME=HOME_PATH) return xonsh_builtins @skip_if_on_windows def test_repath_backslash(home_env): exp = os.listdir(HOME_PATH) exp = {p for p in exp if re.match(r'\w\w.*', p)}
def test_reglob_tests(): testfiles = reglob('test_.*') for f in testfiles: assert_true(f.startswith('test_'))
regexsearch, reglob, superhelper, ) from xonsh.environ import Env from xonsh.pytest.tools import skip_if_on_windows HOME_PATH = os.path.expanduser("~") @pytest.fixture(autouse=True) def xonsh_execer_autouse(xonsh_execer): return xonsh_execer @pytest.mark.parametrize("testfile", reglob("test_.*")) def test_reglob_tests(testfile): assert testfile.startswith("test_") @pytest.fixture def home_env(xession): """Set `__xonsh__.env ` to a new Env instance on `xonsh_builtins`""" xession.env["HOME"] = HOME_PATH return xession @skip_if_on_windows def test_repath_backslash(home_env): exp = os.listdir(HOME_PATH) exp = {p for p in exp if re.match(r"\w\w.*", p)}
from xonsh.built_ins import reglob, pathsearch, helper, superhelper, \ ensure_list_of_strs, list_of_strs_or_callables, regexsearch, \ globsearch, convert_macro_arg, macro_context, call_macro from xonsh.environ import Env from tools import skip_if_on_windows HOME_PATH = os.path.expanduser('~') @pytest.fixture(autouse=True) def xonsh_execer_autouse(xonsh_execer): return xonsh_execer @pytest.mark.parametrize('testfile', reglob('test_.*')) def test_reglob_tests(testfile): assert (testfile.startswith('test_')) @pytest.fixture def home_env(xonsh_builtins): """Set `__xonsh_env__ ` to a new Env instance on `xonsh_builtins`""" xonsh_builtins.__xonsh_env__ = Env(HOME=HOME_PATH) return xonsh_builtins @skip_if_on_windows def test_repath_backslash(home_env): exp = os.listdir(HOME_PATH) exp = {p for p in exp if re.match(r'\w\w.*', p)}
def test_reglob_tests(): testfiles = reglob("test_.*") for f in testfiles: assert_true(f.startswith("test_"))
enter_macro, ) from xonsh.environ import Env from tools import skip_if_on_windows HOME_PATH = os.path.expanduser("~") @pytest.fixture(autouse=True) def xonsh_execer_autouse(xonsh_execer): return xonsh_execer @pytest.mark.parametrize("testfile", reglob("test_.*")) def test_reglob_tests(testfile): assert testfile.startswith("test_") @pytest.fixture def home_env(xonsh_builtins): """Set `__xonsh__.env ` to a new Env instance on `xonsh_builtins`""" xonsh_builtins.__xonsh__.env = Env(HOME=HOME_PATH) return xonsh_builtins @skip_if_on_windows def test_repath_backslash(home_env): exp = os.listdir(HOME_PATH) exp = {p for p in exp if re.match(r"\w\w.*", p)}