Skip to content

Commit

Permalink
test: fix bench
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Feb 1, 2024
1 parent 65e6813 commit c8881b2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"print",
]


# fmt: off
class Emitter:
one_int = Signal(int)
Expand Down Expand Up @@ -221,6 +222,9 @@ def _doit() -> None:
foo.e = (2, "hello")

benchmark(_doit)
for newval, attr in zip([2, "hello", False, 2.0, (2, "hello")], "abcde"):
mock.assert_any_call(EmissionInfo(getattr(foo.events, attr), (newval,)))
assert getattr(foo, attr) == newval
for emitted, attr in zip(
[(2, 1), ("hello", "hi"), (False, True), (2.0, 1.0), ((2, "hello"), (1, "hi"))],
"abcde",
):
mock.assert_any_call(EmissionInfo(getattr(foo.events, attr), emitted))
assert getattr(foo, attr) == emitted[0]

0 comments on commit c8881b2

Please sign in to comment.