diff options
Diffstat (limited to 'Lib/test/test_asynchat.py')
| -rw-r--r-- | Lib/test/test_asynchat.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py index 3471739..f6b17f9 100644 --- a/Lib/test/test_asynchat.py +++ b/Lib/test/test_asynchat.py @@ -11,6 +11,7 @@ import socket import sys import time import unittest +import warnings try: import threading except ImportError: @@ -281,7 +282,10 @@ class TestHelperFunctions(unittest.TestCase): class TestFifo(unittest.TestCase): def test_basic(self): - f = asynchat.fifo() + with warnings.catch_warnings(record=True) as w: + f = asynchat.fifo() + if w: + assert issubclass(w[0].category, DeprecationWarning) f.push(7) f.push(b'a') self.assertEqual(len(f), 2) @@ -296,7 +300,10 @@ class TestFifo(unittest.TestCase): self.assertEqual(f.pop(), (0, None)) def test_given_list(self): - f = asynchat.fifo([b'x', 17, 3]) + with warnings.catch_warnings(record=True) as w: + f = asynchat.fifo([b'x', 17, 3]) + if w: + assert issubclass(w[0].category, DeprecationWarning) self.assertEqual(len(f), 3) self.assertEqual(f.pop(), (1, b'x')) self.assertEqual(f.pop(), (1, 17)) |
