From 938ec42d8d6fe4bde38a2f304feb212e0ca78fa8 Mon Sep 17 00:00:00 2001 From: Alex Chen Date: Thu, 16 Jul 2026 15:17:57 +0000 Subject: [PATCH] Fix optional hypothesmith import on Python 3.14 Catch any Exception when importing hypothesis/hypothesmith so a broken optional dependency (e.g. typing.ByteString removed on 3.14) skips the fuzz test instead of failing collection. Fixes #113 Signed-off-by: Alex Chen --- test_mccabe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test_mccabe.py b/test_mccabe.py index 4ddce38..6e76394 100644 --- a/test_mccabe.py +++ b/test_mccabe.py @@ -10,7 +10,10 @@ try: import hypothesmith from hypothesis import HealthCheck, given, settings, strategies as st -except ImportError: +except Exception: + # Optional dep: missing package (ImportError) or unusable on this + # interpreter (e.g. AttributeError: typing.ByteString removed in 3.14 + # while an older hypothesmith/hypothesis is installed). See #113. hypothesmith = None import mccabe