Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing in callback_on_mock_put #321

Merged
merged 2 commits into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/ophyd_async/core/mock_signal_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from contextlib import asynccontextmanager, contextmanager
from typing import Any, Callable, Generator, Iterable, Iterator, List
from typing import Any, Callable, Iterable, Iterator, List
from unittest.mock import ANY, Mock

from ophyd_async.core.signal import Signal
Expand Down Expand Up @@ -127,11 +127,7 @@ def _unset_side_effect_cm(put_mock: Mock):
put_mock.side_effect = None


# linting isn't smart enought to realize @contextmanager will give use a
# ContextManager[None]
def callback_on_mock_put(
signal: Signal, callback: Callable[[T], None]
) -> Generator[None, None, None]:
def callback_on_mock_put(signal: Signal, callback: Callable[[T], None]):
"""For setting a callback when a backend is put to.

Can either be used in a context, with the callback being
Expand Down
Loading