summaryrefslogtreecommitdiff
path: root/Lib/test/test_telnetlib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-25 13:25:52 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-25 13:25:52 +0200
commit3f19a274c28567afb39ba46ea8a2ebdeab816b0b (patch)
treeb455925dd27f3d6e421d9fca9f3295b988a24254 /Lib/test/test_telnetlib.py
parentb0cbde5d42f12b3aca11b87c017b3c60a26be4fd (diff)
parentc8486579312320fd09c56ce9fce3da7ea0ffd132 (diff)
downloadcpython-3f19a274c28567afb39ba46ea8a2ebdeab816b0b.tar.gz
Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
Py_LIMITED_API is not set or set to the value between 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher.
Diffstat (limited to 'Lib/test/test_telnetlib.py')
-rw-r--r--Lib/test/test_telnetlib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index 8e219f4217..51d82e1158 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -1,7 +1,6 @@
import socket
import selectors
import telnetlib
-import time
import contextlib
from test import support
@@ -42,6 +41,11 @@ class GeneralTests(unittest.TestCase):
telnet = telnetlib.Telnet(HOST, self.port)
telnet.sock.close()
+ def testContextManager(self):
+ with telnetlib.Telnet(HOST, self.port) as tn:
+ self.assertIsNotNone(tn.get_socket())
+ self.assertIsNone(tn.get_socket())
+
def testTimeoutDefault(self):
self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(30)