Skip to content
Myr

test__expand_args.py

This file

Path

tests/test_utils/test__expand_args.py

17 lines · 666 bytes · Python

Last changed by

Merge stable into main. (#3674)Rowlando13before adoption7925a34

History of this file

Take it

Merge stable into main. (#3674)Rowlando13before adoption7925a34

lines 1–17why, one step back
1import os
23import click456def test_expand_args(monkeypatch):7 user = os.path.expanduser("~")8 assert user in click.utils._expand_args(["~"])9 monkeypatch.setenv("CLICK_TEST", "hello")10 assert "hello" in click.utils._expand_args(["$CLICK_TEST"])11 assert "pyproject.toml" in click.utils._expand_args(["*.toml"])12 assert os.path.join("tests", "conftest.py") in click.utils._expand_args(13 ["**/conftest.py"]14 )15 assert "*.not-found" in click.utils._expand_args(["*.not-found"])16 # a bad glob pattern, such as a pytest identifier, should return itself17 assert click.utils._expand_args(["test.py::test_bad"])[0] == "test.py::test_bad"