diff --git a/trio/_tests/test_threads.py b/trio/_tests/test_threads.py index fb1682984b..bca8581853 100644 --- a/trio/_tests/test_threads.py +++ b/trio/_tests/test_threads.py @@ -878,9 +878,8 @@ def sync_check(): from_thread_run_sync(cancel_scope.cancel) try: from_thread_run_sync(bool) - except _core.Cancelled: - # pragma: no cover, sync functions don't raise Cancelled - queue.put(True) + except _core.Cancelled: # pragma: no cover + queue.put(True) # sync functions don't raise Cancelled else: queue.put(False) @@ -903,8 +902,8 @@ def async_check(): from_thread_run_sync(cancel_scope.cancel) try: assert from_thread_run(no_checkpoint) - except _core.Cancelled: - queue.put(True) + except _core.Cancelled: # pragma: no cover + queue.put(True) # sync functions don't raise Cancelled else: queue.put(False)