Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
test that all the methods are present
  • Loading branch information
tungol committed Nov 5, 2024
commit 9c4e3f5e86a00a5c49beeb7c18a958fd4d5f77b1
5 changes: 5 additions & 0 deletions Lib/test/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ def test_context_isinstance(self):
ctx = contextvars.Context()
self.assertIsInstance(ctx, collections.abc.Mapping)
Comment thread
tungol marked this conversation as resolved.

mapping_methods = ("__getitem__", "__iter__", "__len__", "__contains__", "keys",
"items", "values", "get", "__eq__", "__ne__")
for name in mapping_methods:
Comment thread
kumaraditya303 marked this conversation as resolved.
self.assertIn(name, dir(ctx))
Comment thread
tungol marked this conversation as resolved.
Outdated

@isolated_context
@threading_helper.requires_working_threading()
def test_context_threads_1(self):
Expand Down