diff options
-rw-r--r-- | Lib/test/test_cgi.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index d2510a4..5510a0d 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -4,6 +4,7 @@ import os import sys import tempfile import unittest +import warnings from io import StringIO, BytesIO class HackedSysModule: @@ -119,9 +120,13 @@ def gen_result(data, environ): class CgiTests(unittest.TestCase): def test_escape(self): - self.assertEqual("test & string", cgi.escape("test & string")) - self.assertEqual("<test string>", cgi.escape("<test string>")) - self.assertEqual(""test string"", cgi.escape('"test string"', True)) + # cgi.escape() is deprecated. + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', 'cgi\.escape', + DeprecationWarning) + self.assertEqual("test & string", cgi.escape("test & string")) + self.assertEqual("<test string>", cgi.escape("<test string>")) + self.assertEqual(""test string"", cgi.escape('"test string"', True)) def test_strict(self): for orig, expect in parse_strict_test_cases: |