mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
fix isuse #13248: remove previously deprecated asyncore.dispatcher __getattr__ cheap inheritance hack.
This commit is contained in:
parent
63aeb71909
commit
8af740c46a
3 changed files with 3 additions and 31 deletions
|
@ -316,23 +316,6 @@ class DispatcherTests(unittest.TestCase):
|
|||
'warning: unhandled connect event']
|
||||
self.assertEqual(lines, expected)
|
||||
|
||||
def test_issue_8594(self):
|
||||
# XXX - this test is supposed to be removed in next major Python
|
||||
# version
|
||||
d = asyncore.dispatcher(socket.socket())
|
||||
# make sure the error message no longer refers to the socket
|
||||
# object but the dispatcher instance instead
|
||||
self.assertRaisesRegex(AttributeError, 'dispatcher instance',
|
||||
getattr, d, 'foo')
|
||||
# cheap inheritance with the underlying socket is supposed
|
||||
# to still work but a DeprecationWarning is expected
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
warnings.simplefilter("always")
|
||||
family = d.family
|
||||
self.assertEqual(family, socket.AF_INET)
|
||||
self.assertEqual(len(w), 1)
|
||||
self.assertTrue(issubclass(w[0].category, DeprecationWarning))
|
||||
|
||||
def test_strerror(self):
|
||||
# refers to bug #8573
|
||||
err = asyncore._strerror(errno.EPERM)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue