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

Function symlink_or_skip

src/_pytest/pathlib.py:473–482  ·  view source on GitHub ↗

Make a symlink, or skip the test in case symlinks are not supported.

(
    src: os.PathLike[str] | str,
    dst: os.PathLike[str] | str,
    **kwargs: Any,
)

Source from the content-addressed store, hash-verified

471
472
473def symlink_or_skip(
474 src: os.PathLike[str] | str,
475 dst: os.PathLike[str] | str,
476 **kwargs: Any,
477) -> None:
478 """Make a symlink, or skip the test in case symlinks are not supported."""
479 try:
480 os.symlink(src, dst, **kwargs)
481 except OSError as e:
482 skip(f"symlinks not supported: {e}")
483
484
485class ImportMode(Enum):

Calls

no outgoing calls