From b77b116cfeb869953b6b9c40feb570da67067a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sun, 5 Nov 2023 00:16:08 +0200 Subject: [PATCH] Test for the new deprecation warning --- tests/test_to_thread.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_to_thread.py b/tests/test_to_thread.py index 3765af1a..6dc46ba7 100644 --- a/tests/test_to_thread.py +++ b/tests/test_to_thread.py @@ -142,6 +142,11 @@ def wait_event() -> None: assert future.result(1) +async def test_deprecated_cancellable_param() -> None: + with pytest.warns(DeprecationWarning, match="The `cancellable=`"): + await to_thread.run_sync(bool, cancellable=True) + + async def test_contextvar_propagation() -> None: var = ContextVar("var", default=1) var.set(6)