The context is *not* shared between threads.
(self, D)
| 186 | greenlet is not None, reason="Don't mix threads and greenlets." |
| 187 | ) |
| 188 | def test_is_thread_local(self, D): |
| 189 | """ |
| 190 | The context is *not* shared between threads. |
| 191 | """ |
| 192 | |
| 193 | class TestThread(threading.Thread): |
| 194 | def __init__(self, d): |
| 195 | self._d = d |
| 196 | threading.Thread.__init__(self) |
| 197 | |
| 198 | def run(self): |
| 199 | assert "tl" not in self._d._dict |
| 200 | |
| 201 | self._d["tl"] = 23 |
| 202 | |
| 203 | with pytest.deprecated_call(): |
| 204 | d = wrap_dict(dict)() |
| 205 | d["tl"] = 42 |
| 206 | t = TestThread(d) |
| 207 | t.start() |
| 208 | t.join() |
| 209 | |
| 210 | assert 42 == d._dict["tl"] |
| 211 | |
| 212 | def test_context_is_global_to_thread(self, D): |
| 213 | """ |
nothing calls this directly
no test coverage detected