MCPcopy Create free account
hub / github.com/OpenAssetIO/OpenAssetIO / MyFlag

Class MyFlag

src/openassetio-python/tests/cmodule/test_gil.py:68–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67 def test_when_calling_bound_member_in_another_thread_then_doesnt_error(self):
68 class MyFlag(_openassetio._testutils.Flag):
69 def __init__(self):
70 self.value = None
71 _openassetio._testutils.Flag.__init__(self)
72
73 def set(self, value):
74 assert threading.current_thread().ident != main_thread_id
75 self.value = value
76
77 def get(self):
78 return self.value
79
80 flag = MyFlag()
81 main_thread_id = threading.current_thread().ident

Calls

no outgoing calls