From b8370030994b36c0625763f3d7c970e1ad059cae Mon Sep 17 00:00:00 2001 From: Florian Jetter Date: Thu, 28 Apr 2022 01:44:12 +0200 Subject: [PATCH] Do not require pytest_timeout (#6224) --- distributed/utils_test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/distributed/utils_test.py b/distributed/utils_test.py index 1d74afbf83..7c0b3bbd45 100644 --- a/distributed/utils_test.py +++ b/distributed/utils_test.py @@ -77,7 +77,15 @@ except ImportError: pass -from pytest_timeout import is_debugging +try: + from pytest_timeout import is_debugging +except ImportError: + + def is_debugging() -> bool: + # The pytest_timeout logic is more sophisticated. Not only debuggers + # attach a trace callback but vendoring the entire logic is not worth it + return sys.gettrace() is not None + logger = logging.getLogger(__name__)