bpo-37268: test_parser fails when run with -Werror (GH-15183)
authorZackery Spytz <zspytz@gmail.com>
Thu, 8 Aug 2019 21:48:00 +0000 (15:48 -0600)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 8 Aug 2019 21:48:00 +0000 (14:48 -0700)
Use warnings.filterwarnings() when importing the deprecated parser
module.

@pablogsal

https://bugs.python.org/issue37268

Automerge-Triggered-By: @pablogsal
Lib/test/test_parser.py

index ec1845d7fe9ae0315aa18344ad64ca757baf679a..7295f66d393a446a82ceecd03db67f0a31e5f49c 100644 (file)
@@ -1,5 +1,9 @@
 import copy
-import parser
+import warnings
+with warnings.catch_warnings():
+    warnings.filterwarnings('ignore', 'The parser module is deprecated',
+                            DeprecationWarning)
+    import parser
 import pickle
 import unittest
 import operator