mirror of
https://github.com/python/cpython.git
synced 2025-01-24 18:13:57 +08:00
Issue #25911: Tring to silence deprecation warnings in bytes path walk tests.
This commit is contained in:
parent
7ab61ae8aa
commit
ada6db7870
@ -1021,6 +1021,17 @@ class FwalkTests(WalkTests):
|
|||||||
|
|
||||||
class BytesWalkTests(WalkTests):
|
class BytesWalkTests(WalkTests):
|
||||||
"""Tests for os.walk() with bytes."""
|
"""Tests for os.walk() with bytes."""
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
self.stack = contextlib.ExitStack()
|
||||||
|
if os.name == 'nt':
|
||||||
|
self.stack.enter_context(warnings.catch_warnings())
|
||||||
|
warnings.simplefilter("ignore", DeprecationWarning)
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
self.stack.close()
|
||||||
|
super().tearDown()
|
||||||
|
|
||||||
def walk(self, top, **kwargs):
|
def walk(self, top, **kwargs):
|
||||||
if 'follow_symlinks' in kwargs:
|
if 'follow_symlinks' in kwargs:
|
||||||
kwargs['followlinks'] = kwargs.pop('follow_symlinks')
|
kwargs['followlinks'] = kwargs.pop('follow_symlinks')
|
||||||
|
Loading…
Reference in New Issue
Block a user