Increase test coverage
This is a working PR to incrementally improve the test coverage to a percentage that we want. I imagine once we reach this predefined goal, then adding that as a minimum level should fail future CI actions.
As of last commit we are at 75%
Now at 78%
I believe I've capture a lot of the easy wins for unit testing. I want to tackle logs.py errors.py and the mixins next.
Happy to receive feedback so far!
Hey @weklund great initiative 👏
- Did you write these tests by hand or are they AI-generated? If you used AI, did you review it one by one?
- I thought we want to move away from unittest and towards pytest. We've established that both can live safely, so moving towards pytest for any new tests would make sense, right? Happy to discuss this if I'm misunderstanding something here
- I'm trying to adopt the Arrange, Act, Assert sections you've suggested. Possibly we could start using them with these new test here?
- Some of these are AI generated, and should be reviewed more :)
- No you're right... I already forgot ha. Let me fix that.
- No you're right!
Let's try this again :)
Updated subscription controller, will update the oauth tests next
@Voyz I did another pass here, and a slightly different approach. Used AI a bit, but instead of writing, I used it to refactor, reduce, and simplify what the tests were asserting. Curious on your thoughts here. Unfortunate the diff is pretty large, but I have reached 84% coverage now.
Looks like the next biggest gains would be from ws testing, but wanted to follow up on client work in a different PR.
In addition I wanted to wait on adding through coverage to mixins.
Would love your thoughts here! :D
Some actions to take for this PR:
- Review tests and ensure we mock as little as possible
- See more test candidates for parameterize
- Add no coverage where it makes sense
@Voyz Would love your thoughts :)