MCPcopy
hub / github.com/pytest-dev/pytest / test_get_dirs_from_args

Function test_get_dirs_from_args

testing/test_findpaths.py:195–206  ·  view source on GitHub ↗

get_dirs_from_args() skips over non-existing directories and files

(tmp_path)

Source from the content-addressed store, hash-verified

193
194
195def test_get_dirs_from_args(tmp_path):
196 """get_dirs_from_args() skips over non-existing directories and files"""
197 fn = tmp_path / "foo.py"
198 fn.touch()
199 d = tmp_path / "tests"
200 d.mkdir()
201 option = "--foobar=/foo.txt"
202 # xdist uses options in this format for its rsync feature (#7638)
203 xdist_rsync_option = "popen=c:/dest"
204 assert get_dirs_from_args(
205 [str(fn), str(tmp_path / "does_not_exist"), str(d), option, xdist_rsync_option]
206 ) == [fn.parent, d]
207
208
209@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

get_dirs_from_argsFunction · 0.90
mkdirMethod · 0.45

Tested by

no test coverage detected