Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
do not reload() shutil
  • Loading branch information
giampaolo committed Sep 30, 2019
commit 7acc6ae2bce8fcef73b1a9d1ce73d656272506f1
7 changes: 3 additions & 4 deletions Lib/test/test_largefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import stat
import sys
import unittest
import importlib
import socket
import shutil
import threading
from test.support import TESTFN, requires, unlink, bigmemtest, find_unused_port
import io # C implementation of io
Expand Down Expand Up @@ -154,9 +154,8 @@ class TestCopyfile(LargeFileTest, unittest.TestCase):
open = staticmethod(io.open)

def test_it(self):
# ...in case _USE_CP_SENDFILE has been set to False by another test.
import shutil as _shutil
shutil = importlib.reload(_shutil)
# Internally shutil.copyfile() can use "fast copy" methods like
# os.sendfile().
size = os.path.getsize(TESTFN)
shutil.copyfile(TESTFN, TESTFN2)
self.assertEqual(os.path.getsize(TESTFN2), size)
Expand Down