Skip to content

Commit 78940a8

Browse files
committed
Fix CI
1 parent 482b09d commit 78940a8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

hypothesis-python/src/hypothesis/strategies/_internal/types.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@
195195

196196

197197
# Used on `TypeVar` objects with no default:
198-
NoDefault = getattr(typing_extensions, "NoDefault", object())
198+
NoDefaults = (
199+
getattr(typing, "NoDefault", object()),
200+
getattr(typing_extensions, "NoDefault", object()),
201+
)
199202

200203
# We use this variable to be sure that we are working with a type from `typing`:
201204
typing_root_type = (typing._Final, typing._GenericAlias) # type: ignore
@@ -443,7 +446,7 @@ def is_generic_type(type_):
443446
)
444447

445448

446-
def _try_import_forward_ref(thing, typ, *, type_params=()): # pragma: no cover
449+
def _try_import_forward_ref(thing, typ, *, type_params): # pragma: no cover
447450
"""
448451
Tries to import a real bound or default type from ``ForwardRef`` in ``TypeVar``.
449452
@@ -1090,7 +1093,7 @@ def resolve_TypeVar(thing):
10901093
type_var_key = f"typevar={thing!r}"
10911094

10921095
bound = getattr(thing, "__bound__", None)
1093-
default = getattr(thing, "__default__", NoDefault)
1096+
default = getattr(thing, "__default__", NoDefaults[0])
10941097
original_strategies = []
10951098

10961099
def resolve_strategies(typ):
@@ -1106,7 +1109,7 @@ def resolve_strategies(typ):
11061109

11071110
if bound is not None:
11081111
resolve_strategies(bound)
1109-
if default is not NoDefault: # pragma: no cover
1112+
if default not in NoDefaults: # pragma: no cover
11101113
# Coverage requires 3.13 or `typing_extensions` package.
11111114
resolve_strategies(default)
11121115

hypothesis-python/tests/cover/test_type_lookup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def _check_instances(t):
250250
t.__module__ != "typing"
251251
and t.__name__ != "ByteString"
252252
and not t.__module__.startswith("pydantic")
253+
and t.__module__ != "typing_extensions
253254
)
254255

255256

0 commit comments

Comments
 (0)