Skip to content

Commit

Permalink
Remove file_not_found_tmpdir fixture for TestRmtree
Browse files Browse the repository at this point in the history
Since its presence doesn't make things any simpler or more elegant.
(It was left over from a previous approach where it was used in
some @DDT parameters.)
  • Loading branch information
EliahKagan committed Nov 3, 2023
1 parent c4da058 commit aa1799f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ def permission_error_tmpdir(tmp_path):
yield td


@pytest.fixture
def file_not_found_tmpdir(tmp_path):
"""Fixture to test errors deleting a directory that are not due to permissions."""
yield tmp_path / "testdir" # It is deliberately never created.


class TestRmtree:
"""Tests for :func:`git.util.rmtree`."""

Expand Down Expand Up @@ -142,7 +136,9 @@ def test_does_not_wrap_perm_error_unless_enabled(self, mocker, permission_error_
pytest.fail(f"rmtree unexpectedly attempts skip: {ex!r}")

@pytest.mark.parametrize("hide_windows_known_errors", [False, True])
def test_does_not_wrap_other_errors(self, mocker, file_not_found_tmpdir, hide_windows_known_errors):
def test_does_not_wrap_other_errors(self, tmp_path, mocker, hide_windows_known_errors):
file_not_found_tmpdir = tmp_path / "testdir" # It is deliberately never created.

# See comments in test_wraps_perm_error_if_enabled for details about patching.
mocker.patch.object(sys.modules["git.util"], "HIDE_WINDOWS_KNOWN_ERRORS", hide_windows_known_errors)
mocker.patch.object(os, "chmod")
Expand Down

0 comments on commit aa1799f

Please sign in to comment.