diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-08 19:26:44 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-08 19:26:44 (GMT) |
commit | 786e9220542fe82e548a6c305a4c094807415492 (patch) | |
tree | 2a081d9e7b90a93c0e47cc62cc9e850e7e410550 /Lib/test | |
parent | 706379ae0d9a26d73572c74f9fe74019447191e4 (diff) | |
parent | ada6db7870359581d101b28beaa9207a0c5509a1 (diff) | |
download | cpython-786e9220542fe82e548a6c305a4c094807415492.zip cpython-786e9220542fe82e548a6c305a4c094807415492.tar.gz cpython-786e9220542fe82e548a6c305a4c094807415492.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.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 07682f2..1c0dc5b 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -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') |