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 errno
|
||||||
import functools
|
import functools
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from contextlib import ExitStack
|
||||||
from test import support
|
from test import support
|
||||||
from test.support import TESTFN
|
from test.support import TESTFN
|
||||||
from os.path import splitdrive
|
from os.path import splitdrive
|
||||||
|
@ -116,6 +117,8 @@ def test_rmtree_works_on_bytes(self):
|
||||||
write_file(os.path.join(victim, 'somefile'), 'foo')
|
write_file(os.path.join(victim, 'somefile'), 'foo')
|
||||||
victim = os.fsencode(victim)
|
victim = os.fsencode(victim)
|
||||||
self.assertIsInstance(victim, bytes)
|
self.assertIsInstance(victim, bytes)
|
||||||
|
win = (os.name == 'nt')
|
||||||
|
with self.assertWarns(DeprecationWarning) if win else ExitStack():
|
||||||
shutil.rmtree(victim)
|
shutil.rmtree(victim)
|
||||||
|
|
||||||
@support.skip_unless_symlink
|
@support.skip_unless_symlink
|
||||||
|
|
Loading…
Reference in New Issue