-
Notifications
You must be signed in to change notification settings - Fork 69
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 tests, update workflows, support Python 3.12 tests #237
Conversation
|
|
The "slow" tests cannot run on their own, at least how it's currently set up, because it needs to load the sequence into the TestSequence object first with |
Yeah, realized that as well. I introduced a "required_for_slow" marker and then use |
okay, in the 3rd try on my local PC the slow / plot tests failed as well because of some random tkinter error. 4th run was okay, again. However, in the GitHub workflow it seems buggy. Takes ages. IMO we should just remove the current plot tests (and the slow marker) completely. It doesn't really tests anything anyway, does it? Instead I would introduce some dedicated tests for the plot() functionality at some point. Would you be fine with that @FrankZijlstra ? If not, I will just leave it as it was before and simply don't run the tests. |
Would be great if we can merge this soon, as we need it for #238 and #240 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the plot
tests for now is fine with me. Before adding the new Sequence tests, that was one of the only tests that existed, because @wtclarke found some bug with the plotting at the time, I think. It essentially just checks that calling plot
raises no errors. But I agree that with automated tests in a headless environment, plotting could be difficult to get right...
Why remove them? Can you not just patch the |
The plot tests have pypulseq/tests/test_sequence.py Line 278 in 4a25069
The issue with plotting larger sequences (i.e. the sequence examples) is that it is very slow, so not ideal for automated tests on github. |
I think we all agree that testing the plot function makes sense, but running an extremely slow seq.plot() for all example and test sequences without checking the output does not make sense IMO. Some decent tests for the plot function itself should be more useful. |
Surely just test on a small sequence then? I'd suggest adding a single block and try plotting that sequence. It's cool to see the tests over multiple sequence types, but don't use that as an excuse to not test a frequently used feature. As above, this is code that people will feel the need to tweak and users will use. |
I re-introduced and extended the seq.plot() tests for the basic test sequences (seq1, seq2, seq3, seq4). IMO this is still not a meaningful test, because we dont check the outcome at all, but now we know that the method does not raise any errors. Fine for you @wtclarke & @FrankZijlstra ? |
Thanks for doing this. Yeah, I understand your point, but I would say execution without error is still a meaningful test for something that is otherwise hard to test. |
Yes, looks good to me. Minor nitpick is to put the |
All in all, this hopefully simplifies the testing process, removes unnecessary complexity, and is generally better structured.