Test that unbinding from threadlocal works for keys that exist and does not raise error when they do not exist.
(self)
| 378 | ) |
| 379 | |
| 380 | def test_unbind_threadlocal(self): |
| 381 | """ |
| 382 | Test that unbinding from threadlocal works for keys that exist |
| 383 | and does not raise error when they do not exist. |
| 384 | """ |
| 385 | with pytest.deprecated_call(): |
| 386 | bind_threadlocal(a=234, b=34) |
| 387 | |
| 388 | with pytest.deprecated_call(): |
| 389 | assert {"a": 234, "b": 34} == get_threadlocal() |
| 390 | |
| 391 | with pytest.deprecated_call(): |
| 392 | unbind_threadlocal("a") |
| 393 | |
| 394 | with pytest.deprecated_call(): |
| 395 | assert {"b": 34} == get_threadlocal() |
| 396 | |
| 397 | with pytest.deprecated_call(): |
| 398 | unbind_threadlocal("non-existing-key") |
| 399 | |
| 400 | with pytest.deprecated_call(): |
| 401 | assert {"b": 34} == get_threadlocal() |
| 402 | |
| 403 | def test_get_context_no_context(self): |
| 404 | """ |
nothing calls this directly
no test coverage detected