Skip to content

Commit 05d5aa0

Browse files
committed
Get more output about how the windows test is failing.
1 parent 63fbc7a commit 05d5aa0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Lib/test/test_shutil.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,8 +3127,13 @@ def test_file_offset(self):
31273127
def test_win_impl(self):
31283128
# Make sure alternate Windows implementation is called.
31293129
with unittest.mock.patch("shutil._copyfileobj_readinto") as m:
3130-
shutil.copyfile(TESTFN, TESTFN2)
3131-
assert m.called
3130+
with unittest.mock.patch("shutil._fastcopy_fcopyfile") as m1:
3131+
with unittest.mock.patch("shutil._fastcopy_copy_file_range") as m2:
3132+
with unittest.mock.patch("shutil._fastcopy_sendfile") as m3:
3133+
with unittest.mock.patch("shutil.copyfileobj") as m4:
3134+
shutil.copyfile(TESTFN, TESTFN2)
3135+
3136+
assert m.called, f"_copyfileobj_readinto: {m.called}\n_fastcopy_fcopyfile: {m1.called}\n_fastcopy_copy_file_range: {m2.called}\n_fastcopy_sendfile: {m3.called}\ncopyfileobj: {m4.called}"
31323137

31333138
# File size is 2 MiB but max buf size should be 1 MiB.
31343139
self.assertEqual(m.call_args[0][2], 1 * 1024 * 1024)

0 commit comments

Comments
 (0)