summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_context.py
diff options
context:
space:
mode:
authorAMIR <31338382+amiremohamadi@users.noreply.github.com>2019-12-08 11:35:59 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-12-08 11:35:59 (GMT)
commit28c91631c24e53713ad0e8a2bbae716373f5e53d (patch)
treea870b24a5128a4424e85cd2e4ad6693417e1c0c4 /Lib/test/test_context.py
parent00ada2c1d57c5b8b468bad32ff24fa14113ae5c7 (diff)
downloadcpython-28c91631c24e53713ad0e8a2bbae716373f5e53d.zip
cpython-28c91631c24e53713ad0e8a2bbae716373f5e53d.tar.gz
cpython-28c91631c24e53713ad0e8a2bbae716373f5e53d.tar.bz2
bpo-38979: fix ContextVar "__class_getitem__" method (GH-17497)
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov
Diffstat (limited to 'Lib/test/test_context.py')
-rw-r--r--Lib/test/test_context.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_context.py b/Lib/test/test_context.py
index efd7319..b9e991a 100644
--- a/Lib/test/test_context.py
+++ b/Lib/test/test_context.py
@@ -38,9 +38,6 @@ class ContextTest(unittest.TestCase):
self.assertNotEqual(hash(c), hash('aaa'))
- def test_context_var_new_2(self):
- self.assertIsNone(contextvars.ContextVar[int])
-
@isolated_context
def test_context_var_repr_1(self):
c = contextvars.ContextVar('a')
@@ -361,6 +358,10 @@ class ContextTest(unittest.TestCase):
tp.shutdown()
self.assertEqual(results, list(range(10)))
+ def test_contextvar_getitem(self):
+ clss = contextvars.ContextVar
+ self.assertEqual(clss[str], clss)
+
# HAMT Tests