summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-08-07 16:38:37 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-08-07 16:38:37 (GMT)
commit41ad77c69718e7864eac62c8cd9034c3b51fb93e (patch)
treea1110535d27c43ef054d0e0546e06e9b8b437a5d /Lib/test/test_shutil.py
parent22f2d2efb7ffdbbd8eca8bddbeb99e970a7975e7 (diff)
downloadcpython-41ad77c69718e7864eac62c8cd9034c3b51fb93e.zip
cpython-41ad77c69718e7864eac62c8cd9034c3b51fb93e.tar.gz
cpython-41ad77c69718e7864eac62c8cd9034c3b51fb93e.tar.bz2
Issue #20056: Fixed deprecation warning about bytes path in test_shutil on
Windows. Path by Vajrasky Kok.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index a483fe1..66b3fb1 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -10,6 +10,7 @@ import os.path
import errno
import functools
import subprocess
+from contextlib import ExitStack
from test import support
from test.support import TESTFN
from os.path import splitdrive
@@ -116,7 +117,9 @@ class TestShutil(unittest.TestCase):
write_file(os.path.join(victim, 'somefile'), 'foo')
victim = os.fsencode(victim)
self.assertIsInstance(victim, bytes)
- shutil.rmtree(victim)
+ win = (os.name == 'nt')
+ with self.assertWarns(DeprecationWarning) if win else ExitStack():
+ shutil.rmtree(victim)
@support.skip_unless_symlink
def test_rmtree_fails_on_symlink(self):