summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-08 19:26:26 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-08 19:26:26 (GMT)
commitada6db7870359581d101b28beaa9207a0c5509a1 (patch)
treee42c027fd772f6443132ea04390cd6f40bafa8e1 /Lib/test
parent7ab61ae8aa4a83e2f63c9c949096d42c22ee247f (diff)
downloadcpython-ada6db7870359581d101b28beaa9207a0c5509a1.zip
cpython-ada6db7870359581d101b28beaa9207a0c5509a1.tar.gz
cpython-ada6db7870359581d101b28beaa9207a0c5509a1.tar.bz2
Issue #25911: Tring to silence deprecation warnings in bytes path walk tests.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_os.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 73db39c..66f5634 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1021,6 +1021,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')