From: Serhiy Storchaka Date: Tue, 8 Mar 2016 19:26:26 +0000 (+0200) Subject: Issue #25911: Tring to silence deprecation warnings in bytes path walk tests. X-Git-Tag: v3.6.0a1~510^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ada6db7870359581d101b28beaa9207a0c5509a1;p=thirdparty%2FPython%2Fcpython.git Issue #25911: Tring to silence deprecation warnings in bytes path walk tests. --- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 73db39c8258e..66f563465fe3 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')