Skip to content

Commit

Permalink
tests: use safe_rmtree instead of custom logic
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Apr 28, 2022
1 parent 532a5a5 commit c8a816c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from poetry.utils.env import EnvManager
from poetry.utils.env import SystemEnv
from poetry.utils.env import VirtualEnv
from poetry.utils.helpers import safe_rmtree
from tests.helpers import TestLocker
from tests.helpers import TestRepository
from tests.helpers import get_package
Expand Down Expand Up @@ -306,7 +307,7 @@ def tmp_dir() -> Iterator[str]:

yield dir_

shutil.rmtree(dir_)
safe_rmtree(dir_)


@pytest.fixture
Expand Down
15 changes: 0 additions & 15 deletions tests/integration/test_utils_vcs_git.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from __future__ import annotations

import stat
import uuid

from copy import deepcopy
from hashlib import sha1
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Iterator

import pytest

Expand All @@ -17,7 +15,6 @@
from poetry.core.pyproject.toml import PyProjectTOML

from poetry.console.exceptions import PoetrySimpleConsoleException
from poetry.utils._compat import WINDOWS
from poetry.vcs.git import Git
from poetry.vcs.git.backend import GitRefSpec

Expand Down Expand Up @@ -62,18 +59,6 @@ def setup(config: Config) -> None:
}


@pytest.fixture(autouse=WINDOWS)
def cleanup_set_readonly_permissions_windows(tmp_dir: str) -> Iterator[None]:
"""
Ensure all read-only files created by git are set to writable
"""
yield

for path in Path(tmp_dir).glob("**/.git/**/*"):
if path.is_file():
path.chmod(mode=stat.S_IWRITE)


@pytest.fixture
def use_system_git_client(config: Config) -> None:
config.merge({"experimental": {"system-git-client": True}})
Expand Down

0 comments on commit c8a816c

Please sign in to comment.