diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-08-07 16:38:37 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-08-07 16:38:37 (GMT) |
commit | 41ad77c69718e7864eac62c8cd9034c3b51fb93e (patch) | |
tree | a1110535d27c43ef054d0e0546e06e9b8b437a5d /Lib/test | |
parent | 22f2d2efb7ffdbbd8eca8bddbeb99e970a7975e7 (diff) | |
download | cpython-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')
-rw-r--r-- | Lib/test/test_shutil.py | 5 |
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): |