Refactor a lot of test assertions to pytest style#794
Merged
Conversation
Changed Files
|
This was referenced May 1, 2026
Member
Author
|
Note: I will clean up the commit history before merging. |
Contributor
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #794 +/- ##
=======================================
Coverage 83.41% 83.41%
=======================================
Files 47 47
Lines 4203 4203
Branches 615 615
=======================================
Hits 3506 3506
Misses 567 567
Partials 130 130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
roedoejet
approved these changes
May 1, 2026
Squash of: - refactor(tests): replace all one-line self.assertTrue(x) by assert x - refactor(tests): replace all one-liner self.assertIn(a,b) by assert a in b - refactor(tests): replace assertEqual by assert == with a safe regex - refactor(tests): more assert conversions that can be done automatically - test: allow older pytest (>7, which requires pytest-subtests separately)
2b8975f to
d095dee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Goal?
Moving further along in the pytest conversion, this PR takes advantage of the nicer assertions and fixtures that pytest provides.
The idea going forward is to always write pytest-style tests, with
assert <expr>everywhere, and no longer useTestCaseat all. This PR does not go 100% there, but it moves significantly in that direction. For the submodules, however, it's a 100% completed conversion.Feedback sought?
sanity checking I guess. It's a long diff, but it only touches tests files.
Priority?
normal
How to test?
pytestin the parent branch and runningpytestin this one.Confidence?
high
Version change?
no
Related PRs?
EveryVoiceTTS/wav2vec2aligner#30
EveryVoiceTTS/FastSpeech2_lightning#139