mirror of
https://github.com/python/cpython
synced 2026-09-29 09:40:29 +03:00
Issue #25911: Tring to silence deprecation warnings in bytes path walk tests.
This commit is contained in:
commit
786e922054
1 changed files with 11 additions and 0 deletions
|
|
@ -1020,6 +1020,17 @@ class FwalkTests(WalkTests):
|
|||
|
||||
class BytesWalkTests(WalkTests):
|
||||
"""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):
|
||||
if 'follow_symlinks' in kwargs:
|
||||
kwargs['followlinks'] = kwargs.pop('follow_symlinks')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue