Improve test coverage in key.py#44
Conversation
I often start with
Yeah, that is a good point, though all the modes we have so far have 7, so I think I probably had that as a sanity check. Useful validation checks here might be that the first one is 0 and the last one is less than 12 (so that |
Yeah I think it is not too bad with pytest. I think that is better since user already has access to the lists. |
Looks like |
|
Sorry to be slow; Thanks for the feedback! -- I'll try to get some fixes in and ask for re-review before the weekend. |
|
Some fixes. Decided not to loosen the definition of a scale: The checks currently in place are good for the scope of this project, but whatever you think best. Not up to 100% coverage of |
|
... latest commits introduced errors. Back in my court. |
|
@mccalluc do you have time to finish this PR? I could do it if not. |
|
Hi @mccalluc just wanted to check again if you were interested in working more on this PR. If not, I may start editing soon. I want to get this in and do an official v0.1 release this summer. |
|
If you want to take it from here, feel free! I haven't thought about this in a while, and would need to re-learn the code base. Thanks, and sorry for not seeing it to the finish line. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
==========================================
+ Coverage 90.02% 92.00% +1.98%
==========================================
Files 9 9
Lines 1333 1339 +6
==========================================
+ Hits 1200 1232 +32
+ Misses 133 107 -26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks a lot @mccalluc for your help here! |
This improves test coverage in
key.py: It does not bring it to 100%.relative(): The logic here is complicated and I felt a little out of my depth.print_*()methods is possible... but before investing time there, wondering if it would make sense to replace these with methods that return formatted string? But maybe for the sake of convenience, format and print in one function is better...warningsto make sure the warning happens where we expect, but not emit the actual warning during the test run._scale_intervals()brings up a couple questions:assertis not the best tool for input validation, because it may not be evaluated in all environments, but this is a stylistic preference.This has been a good refresher on python and music theory, but I'm not blocked: I'm happy to revise if you have comments, but I don't want to create work for you either.