mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix the warnings filter usage in test_http_cookies.
This commit is contained in:
parent
2298d538b3
commit
d3791ed450
1 changed files with 11 additions and 4 deletions
|
@ -1,15 +1,22 @@
|
||||||
# Simple test suite for http/cookies.py
|
# Simple test suite for http/cookies.py
|
||||||
|
|
||||||
from test.support import run_unittest, run_doctest
|
from test.support import run_unittest, run_doctest, check_warnings
|
||||||
import unittest
|
import unittest
|
||||||
from http import cookies
|
from http import cookies
|
||||||
|
|
||||||
import warnings
|
import warnings
|
||||||
warnings.filterwarnings("ignore",
|
|
||||||
".* class is insecure.*",
|
|
||||||
DeprecationWarning)
|
|
||||||
|
|
||||||
class CookieTests(unittest.TestCase):
|
class CookieTests(unittest.TestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self._warnings_manager = check_warnings()
|
||||||
|
self._warnings_manager.__enter__()
|
||||||
|
warnings.filterwarnings("ignore", ".* class is insecure.*",
|
||||||
|
DeprecationWarning)
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
self._warnings_manager.__exit__(None, None, None)
|
||||||
|
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
cases = [
|
cases = [
|
||||||
{ 'data': 'chips=ahoy; vienna=finger',
|
{ 'data': 'chips=ahoy; vienna=finger',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue