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

added Assertion error messages to assert_ functions #307

Conversation

Relm-Arrowny
Copy link
Contributor

Added assert error messages to fix #296.

Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, a few nitpicks, only major thing is the content of the error message

@@ -316,7 +316,8 @@ async def assert_reading(
await assert_reading(readable, reading)

"""
assert await readable.read() == reading
the_reading = await readable.read()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think actual_reading and expected_reading are more informative names than the_reading and reading. Ditto for configuration.

src/ophyd_async/core/signal.py Outdated Show resolved Hide resolved
src/ophyd_async/core/signal.py Outdated Show resolved Hide resolved
@Relm-Arrowny
Copy link
Contributor Author

Made it easier to play spot the different when assertion failed by adding some colour and spaces.

Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Relm-Arrowny Relm-Arrowny marked this pull request as ready for review May 16, 2024 12:45
@Relm-Arrowny Relm-Arrowny merged commit 4c4da2c into main May 16, 2024
18 checks passed
@Relm-Arrowny Relm-Arrowny deleted the 296-assert_reading-and-assert_configuration-do-not-print-a-differror-info branch May 16, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assert_reading and assert_configuration do not print a diff/error info
2 participants