summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asynchat.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asynchat.py')
-rw-r--r--Lib/test/test_asynchat.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py
index f93a52d..55e0d2a 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -8,6 +8,7 @@ thread = support.import_module('_thread')
import asyncore, asynchat, socket, time
import unittest
import sys
+import warnings
try:
import threading
except ImportError:
@@ -260,7 +261,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)
@@ -275,7 +279,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))