Skip to content

Commit

Permalink
avoid colliding git clones
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Mar 3, 2024
1 parent 3153e9b commit 0ad5801
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import shutil
import sys
import tempfile
import urllib.parse

from pathlib import Path
Expand All @@ -14,7 +15,6 @@
from poetry.core.packages.utils.link import Link
from poetry.core.vcs.git import ParsedUrl

from poetry.config.config import Config
from poetry.console.application import Application
from poetry.factory import Factory
from poetry.installation.executor import Executor
Expand Down Expand Up @@ -117,7 +117,8 @@ def mock_clone(
folder = FIXTURE_PATH / "git" / parsed.resource / path

if not source_root:
source_root = Path(Config.create().get("cache-dir")) / "src"
temp_dir = tempfile.mkdtemp()
source_root = Path(temp_dir) / "src"

dest = source_root / path
dest.parent.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit 0ad5801

Please sign in to comment.