File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3127,8 +3127,13 @@ def test_file_offset(self):
3127
3127
def test_win_impl (self ):
3128
3128
# Make sure alternate Windows implementation is called.
3129
3129
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 } \n copyfileobj: { m4 .called } "
3132
3137
3133
3138
# File size is 2 MiB but max buf size should be 1 MiB.
3134
3139
self .assertEqual (m .call_args [0 ][2 ], 1 * 1024 * 1024 )
You can’t perform that action at this time.
0 commit comments