Skip to content

Commit 077612b

Browse files
committed
Fix checks in tests
The checks in the data sourcing actor were meant to check if the value of the sample was `None`, not the sample itself (as the type system guarantees that `sample` will never be `None`. This issue wasn't detected because the `ChannelRegistry` used `Any` as message type, so `sample` had type `Any`, which means that as far as the type system is concerned, it could have been `None`. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 713e00e commit 077612b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/actor/test_data_sourcing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ async def test_data_sourcing_actor(self) -> None:
8383

8484
for _ in range(3):
8585
sample = await soc_recv.receive()
86-
assert sample is not None
86+
assert sample.value is not None
8787
assert 9.0 == sample.value.base_value
8888

8989
sample = await soc2_recv.receive()
90-
assert sample is not None
90+
assert sample.value is not None
9191
assert 9.0 == sample.value.base_value
9292

9393
sample = await active_power_recv.receive()
94-
assert sample is not None
94+
assert sample.value is not None
9595
assert 100.0 == sample.value.base_value
9696

9797
assert await server.graceful_shutdown()

0 commit comments

Comments
 (0)