]> granicus.if.org Git - python/commitdiff
#6916: attempt to fix BB failure
authorGiampaolo Rodola' <g.rodola@gmail.com>
Sun, 22 Jun 2014 10:43:19 +0000 (12:43 +0200)
committerGiampaolo Rodola' <g.rodola@gmail.com>
Sun, 22 Jun 2014 10:43:19 +0000 (12:43 +0200)
Lib/test/test_asynchat.py

index dd606d662db10bd2cca116fb0e514d83bb6d1422..55e0d2ab2f4da94ea9141008f2c09f36bb836cd4 100644 (file)
@@ -263,7 +263,8 @@ class TestFifo(unittest.TestCase):
     def test_basic(self):
         with warnings.catch_warnings(record=True) as w:
             f = asynchat.fifo()
-            assert issubclass(w[0].category, DeprecationWarning)
+            if w:
+                assert issubclass(w[0].category, DeprecationWarning)
         f.push(7)
         f.push(b'a')
         self.assertEqual(len(f), 2)
@@ -280,7 +281,8 @@ class TestFifo(unittest.TestCase):
     def test_given_list(self):
         with warnings.catch_warnings(record=True) as w:
             f = asynchat.fifo([b'x', 17, 3])
-            assert issubclass(w[0].category, DeprecationWarning)
+            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))