Skip to content

Commit aa1799f

Browse files
committed
Remove file_not_found_tmpdir fixture for TestRmtree
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.)
1 parent c4da058 commit aa1799f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

test/test_util.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ def permission_error_tmpdir(tmp_path):
5959
yield td
6060

6161

62-
@pytest.fixture
63-
def file_not_found_tmpdir(tmp_path):
64-
"""Fixture to test errors deleting a directory that are not due to permissions."""
65-
yield tmp_path / "testdir" # It is deliberately never created.
66-
67-
6862
class TestRmtree:
6963
"""Tests for :func:`git.util.rmtree`."""
7064

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

144138
@pytest.mark.parametrize("hide_windows_known_errors", [False, True])
145-
def test_does_not_wrap_other_errors(self, mocker, file_not_found_tmpdir, hide_windows_known_errors):
139+
def test_does_not_wrap_other_errors(self, tmp_path, mocker, hide_windows_known_errors):
140+
file_not_found_tmpdir = tmp_path / "testdir" # It is deliberately never created.
141+
146142
# See comments in test_wraps_perm_error_if_enabled for details about patching.
147143
mocker.patch.object(sys.modules["git.util"], "HIDE_WINDOWS_KNOWN_ERRORS", hide_windows_known_errors)
148144
mocker.patch.object(os, "chmod")

0 commit comments

Comments
 (0)