-
Notifications
You must be signed in to change notification settings - Fork 333
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
Extract init communication #1005
base: master
Are you sure you want to change the base?
Extract init communication #1005
Conversation
97284ba
to
f808caf
Compare
I got a new idea:
Reasoning:
ToDos, if this idea gets accepted:
EDIT: The code reflects this idea. |
f808caf
to
0d44cf1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1005 +/- ##
==========================================
+ Coverage 58.48% 58.81% +0.33%
==========================================
Files 262 261 -1
Lines 18198 18121 -77
==========================================
+ Hits 10643 10658 +15
+ Misses 7555 7463 -92
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
What do you think, @bilderbuchi ? |
Thanks for asking for my feedback! :-)
I think test-related code should not leak into the instrument codebase. With this change, now part of the protocol test definition resides in the test files, and part in the instrument implementation ( I'm not sure why this is necessary in the first place because I could only give this a skim-read? Especially, because in the test files you now extract it back to a module-level constant again, anyway? (e.g. Is this pattern the reason? Is this purely for test_all_instruments being able to test instruments that have some communication in Can't we inject that A drawback of this is that the init comm pairs reside not with the test files of the relevant instrument. |
0d44cf1
to
8a0a00e
Compare
Exactly, the change is purely to be able to test instruments that communicate in their Yeah, maybe we can find a way to extract the init_comm_pairs from the test files. |
In order to expand all instrument tests, I moved all the communication in the
__init__
methods into their own_init_communication
method.That allows to replace that method for certain tests.
The name of that method could be different, if required.