[Python-checkins] cpython (merge 3.5 -> default): Issue #25911: Tring to silence deprecation warnings in bytes path walk tests.
serhiy.storchaka
python-checkins at python.org
Tue Mar 8 14:32:02 EST 2016
https://hg.python.org/cpython/rev/ecf4e51c222f
changeset: 100467:ecf4e51c222f
parent: 100465:0a749e651aa6
parent: 100466:757159fb4847
user: Serhiy Storchaka <storchaka at gmail.com>
date: Tue Mar 08 21:26:44 2016 +0200
summary:
Issue #25911: Tring to silence deprecation warnings in bytes path walk tests.
files:
Lib/test/test_os.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1020,6 +1020,17 @@
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')
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list