Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assertpy2/assertpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ class NegatedBuilder:
def __init__(self, builder: AssertionBuilder) -> None:
self._builder = builder

def __getattr__(self, name: str) -> object:
def __getattr__(self, name: str) -> Callable[..., AssertionBuilder]:
if name in _NON_NEGATABLE:
raise TypeError(_NON_NEGATABLE[name])
attr = getattr(self._builder, name)
Expand Down
1 change: 1 addition & 0 deletions tests/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
assert_type(assert_that(bytearray(b"raw")), _BytesAssertion[bytearray])
assert_type(assert_that(len), _CallableAssertion)
assert_type(assert_that(object()), AssertionBuilder[object])
assert_type(assert_that(42).not_.is_equal_to(43), AssertionBuilder[Any])

# The iterable-cluster methods stay on their protocol (return Self), so chaining keeps the type.
assert_type(assert_that([1, 2]).satisfies_exactly(lambda x: x > 0, lambda x: x > 1), _IterableAssertion[int])
Expand Down