conftest.py
This file
Path
tests/conftest.py
31 lines · 794 bytes · Python
Last changed by
Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionc3687bf
History of this fileTake it
The walk stopped after 200 commits: lines older than 11e31fd point at it.
Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionc3687bf
lines 1–4why, one step back1import os2import shutil3import tempfile4Merge pull request #1576 from pallets/dependabot/pip/sphinx-3.1.0dependabot-preview[bot]before adoption11e31fd
lines 5–12why, one step back5import pytest67from click.testing import CliRunner8910@pytest.fixture(scope="function")11def runner(request):12 return CliRunner()Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionc3687bf
lines 13–31why, one step back131415def check_symlink_impl():16 """This function checks if using symlinks is allowed17 on the host machine"""18 tempdir = tempfile.mkdtemp(prefix="click-")19 test_pth = os.path.join(tempdir, "check_sym_impl")20 sym_pth = os.path.join(tempdir, "link")21 open(test_pth, "w").close()22 rv = True23 try:24 os.symlink(test_pth, sym_pth)25 except (NotImplementedError, OSError):26 # Creating symlinks on Windows require elevated access.27 # OSError is thrown if the function is called without it.28 rv = False29 finally:30 shutil.rmtree(tempdir, ignore_errors=True)31 return rv