-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add type tests for all exported objects
- Loading branch information
Showing
7 changed files
with
610 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
- case: |- | ||
check_in_yaml | ||
mypy_config: | | ||
ignore_missing_imports = True | ||
main: |- | ||
import trio | ||
reveal_type(trio.MemoryReceiveChannel) # N: Revealed type is "def [ReceiveType] (state: trio._channel.MemoryChannelState[ReceiveType`1], closed: builtins.bool =, tasks: builtins.set[trio._core._run.Task] =) -> trio._channel.MemoryReceiveChannel[ReceiveType`1]" | ||
reveal_type(trio.MemoryReceiveChannel.aclose) # N: Revealed type is "def [ReceiveType] (self: trio._channel.MemoryReceiveChannel[ReceiveType`1]) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.MemoryReceiveChannel.clone) # N: Revealed type is "def [ReceiveType] (self: trio._channel.MemoryReceiveChannel[ReceiveType`1]) -> trio._channel.MemoryReceiveChannel[ReceiveType`1]" | ||
reveal_type(trio.MemoryReceiveChannel.close) # N: Revealed type is "def [ReceiveType] (self: trio._channel.MemoryReceiveChannel[ReceiveType`1])" | ||
reveal_type(trio.MemoryReceiveChannel.receive) # N: Revealed type is "def [ReceiveType] (self: trio._channel.MemoryReceiveChannel[ReceiveType`1]) -> typing.Coroutine[Any, Any, ReceiveType`1]" | ||
reveal_type(trio.MemoryReceiveChannel.receive_nowait) # N: Revealed type is "def [ReceiveType] (self: trio._channel.MemoryReceiveChannel[ReceiveType`1]) -> ReceiveType`1" | ||
reveal_type(trio.MemoryReceiveChannel.statistics) # N: Revealed type is "def [ReceiveType] (self: trio._channel.MemoryReceiveChannel[ReceiveType`1]) -> trio._channel.MemoryChannelStats" | ||
reveal_type(trio.MemorySendChannel) # N: Revealed type is "def [SendType] (state: trio._channel.MemoryChannelState[SendType`1], closed: builtins.bool =, tasks: builtins.set[trio._core._run.Task] =) -> trio._channel.MemorySendChannel[SendType`1]" | ||
reveal_type(trio.MemorySendChannel.aclose) # N: Revealed type is "def [SendType] (self: trio._channel.MemorySendChannel[SendType`1]) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.MemorySendChannel.clone) # N: Revealed type is "def [SendType] (self: trio._channel.MemorySendChannel[SendType`1]) -> trio._channel.MemorySendChannel[SendType`1]" | ||
reveal_type(trio.MemorySendChannel.close) # N: Revealed type is "def [SendType] (self: trio._channel.MemorySendChannel[SendType`1])" | ||
reveal_type(trio.MemorySendChannel.send) # N: Revealed type is "def [SendType] (self: trio._channel.MemorySendChannel[SendType`1], value: SendType`1) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.MemorySendChannel.send_nowait) # N: Revealed type is "def [SendType] (self: trio._channel.MemorySendChannel[SendType`1], value: SendType`1)" | ||
reveal_type(trio.MemorySendChannel.statistics) # N: Revealed type is "def [SendType] (self: trio._channel.MemorySendChannel[SendType`1]) -> trio._channel.MemoryChannelStats" | ||
reveal_type(trio.Process.encoding) # N: Revealed type is "None" | ||
reveal_type(trio.Process.errors) # N: Revealed type is "None" | ||
reveal_type(trio.Process.universal_newlines) # N: Revealed type is "builtins.bool" | ||
reveal_type(trio.TASK_STATUS_IGNORED) # N: Revealed type is "trio._core._run._TaskStatusIgnored" | ||
reveal_type(trio.abc.Channel.receive) # N: Revealed type is "def [T] (self: trio._abc.ReceiveChannel[ReceiveType`1]) -> typing.Coroutine[Any, Any, ReceiveType`1]" | ||
reveal_type(trio.abc.Channel.send) # N: Revealed type is "def [T] (self: trio._abc.SendChannel[SendType`1], value: SendType`1) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.abc.ReceiveChannel.receive) # N: Revealed type is "def [ReceiveType] (self: trio._abc.ReceiveChannel[ReceiveType`1]) -> typing.Coroutine[Any, Any, ReceiveType`1]" | ||
reveal_type(trio.abc.SendChannel.send) # N: Revealed type is "def [SendType] (self: trio._abc.SendChannel[SendType`1], value: SendType`1) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.lowlevel.FdStream.aclose) # N: Revealed type is "def (self: trio._unix_pipes.FdStream) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.lowlevel.FdStream.close) # N: Revealed type is "def (self: trio._unix_pipes.FdStream)" | ||
reveal_type(trio.lowlevel.FdStream.fileno) # N: Revealed type is "def (self: trio._unix_pipes.FdStream) -> builtins.int" | ||
reveal_type(trio.lowlevel.FdStream.receive_some) # N: Revealed type is "def (self: trio._unix_pipes.FdStream, max_bytes: Union[builtins.int, None] =) -> typing.Coroutine[Any, Any, builtins.bytes]" | ||
reveal_type(trio.lowlevel.FdStream.send_all) # N: Revealed type is "def (self: trio._unix_pipes.FdStream, data: builtins.bytes) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.lowlevel.FdStream.wait_send_all_might_not_block) # N: Revealed type is "def (self: trio._unix_pipes.FdStream) -> typing.Coroutine[Any, Any, None]" | ||
reveal_type(trio.lowlevel.Task) # N: Revealed type is "def (parent_nursery: Any, coro: Any, runner: Any, name: Any, context: Any, next_send_fn: Any =, next_send: Any =, abort_func: Any =, custom_sleep_data: Any =, child_nurseries: Any =, eventual_parent_nursery: Any =, cancel_points: Any =, schedule_points: Any =, cancel_status: Any =) -> trio._core._run.Task" | ||
reveal_type(trio.lowlevel.add_instrument) # N: Revealed type is "def (instrument: trio._abc.Instrument)" | ||
reveal_type(trio.lowlevel.open_process) # N: Revealed type is "def (command: Any, *, stdin: Any =, stdout: Any =, stderr: Any =, **options: Any) -> typing.Coroutine[Any, Any, trio._subprocess.Process]" | ||
reveal_type(trio.lowlevel.remove_instrument) # N: Revealed type is "def (instrument: trio._abc.Instrument)" | ||
reveal_type(trio.lowlevel.start_guest_run) # N: Revealed type is "def (async_fn: Any, *args: Any, *, run_sync_soon_threadsafe: Any, done_callback: Any, run_sync_soon_not_threadsafe: Any =, host_uses_signal_set_wakeup_fd: builtins.bool =, clock: Any =, instruments: Any =, restrict_keyboard_interrupt_to_checkpoints: builtins.bool =, strict_exception_groups: builtins.bool =) -> Any" | ||
reveal_type(trio.lowlevel.start_thread_soon) # N: Revealed type is "def (fn: Any, deliver: Any, name: Union[builtins.str, None] =) -> Any" | ||
reveal_type(trio.lowlevel.wait_task_rescheduled) # N: Revealed type is "def (abort_func: def (def () -> <nothing>) -> trio._core._traps.Abort) -> typing.Coroutine[Any, Any, Any]" | ||
reveal_type(trio.open_memory_channel) # N: Revealed type is "def [T] (max_buffer_size: builtins.int) -> Tuple[trio._channel.MemorySendChannel[T`1], trio._channel.MemoryReceiveChannel[T`1], fallback=trio._channel.open_memory_channel[T`1]]" | ||
reveal_type(trio.run) # N: Revealed type is "def (async_fn: Any, *args: Any, *, clock: Any =, instruments: Any =, restrict_keyboard_interrupt_to_checkpoints: builtins.bool =, strict_exception_groups: builtins.bool =) -> Any" | ||
reveal_type(trio.socket.IP_BIND_ADDRESS_NO_PORT) # N: Revealed type is "builtins.int" | ||
reveal_type(trio.to_thread.run_sync) # N: Revealed type is "def (sync_fn: Any, *args: Any, *, thread_name: Union[builtins.str, None] =, cancellable: Any =, limiter: Any =) -> typing.Coroutine[Any, Any, Any]" |
Oops, something went wrong.