Skip to content

Commit 695beec

Browse files
committed
Add comment about why assert isinstance is needed
1 parent 15cedf7 commit 695beec

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test-runner/wasi_test_runner/runtime_adapter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ def run_test(self, test_path: str, config: Config, wasi_version: WasiVersion) ->
127127
if proc is None:
128128
result.failures.append(Failure.unexpected("Read operation called before Run"))
129129
else:
130+
# Instance asserts might seems redudant here, given the match.
131+
# Asserts merely exist to ensure that mypy can fully resolve the underlying type;
132+
# else it will report errors like:
133+
# wasi_test_runner/runtime_adapter.py:131: error: Argument 2 to "_handle_read" has incompatible type "Read"; expected "Read" [arg-type]
130134
assert isinstance(read, Read)
131135
_handle_read(proc, read, result)
132136
case Wait() as wait:

0 commit comments

Comments
 (0)