mirror of https://github.com/python/cpython.git
Issue #20056: Fixed deprecation warning about bytes path in test_shutil on
Windows. Path by Vajrasky Kok.
This commit is contained in:
parent
22f2d2efb7
commit
41ad77c697
|
@ -10,6 +10,7 @@
|
|||
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 @@ def test_rmtree_works_on_bytes(self):
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue