Skip to content

Commit

Permalink
type checking test
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Mar 31, 2024
1 parent a9666f5 commit 75b5f0e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/units/protocols/test_async_context_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@ class AsyncContextLockProtocolImplementation(AsyncContextLockProtocol):

with pytest.raises(NotImplementedError, match=full_match('Do not use the protocol as a lock.')): # type: ignore[operator]
AsyncContextLockProtocolImplementation().__aexit__(None, None, None)


def tests_for_type_checking(): # type: ignore[no-untyped-def]
def some_function(lock: AsyncContextLockProtocol) -> AsyncContextLockProtocol:
return lock

some_function(ALock())

0 comments on commit 75b5f0e

Please sign in to comment.