TST: Refactor remaining common tests to use pytest #2491
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.
Follow up to #2462 and #2478
This deals with all the remaining tests that rely/relied on
PeftCommonTester
. For each test file, I created a separate commit, which may help reviewing.After this is merged, I'll probably do another PR to do some clean up (e.g. no longer using
self.skipTest
, eliminating code duplication).This is what I had to say to each file:
Refactor
test_adaption_prompt.py
PeftCommonTester
, thus removed itRefactor
test_multitask_prompt_tuning.py
Same arguments apply as for
test_adaption_prompt.py
Refactor
test_feature_extraction.py
Pretty straightforward, test coverage is 100% identical.
Refactor
test_stablediffusion.py
This was also pretty straightforward. After refactoring, the test coverage was 100% the same.
I noticed, however, that these tests did not cover LoKr, they only pretended to:
peft/tests/test_stablediffusion.py
Lines 113 to 114 in 37f8dc3
Thus I added LoKr to the test matrix, after which the test coverage if of course different, but is fine. Unfortunately, LoKr merging tests fail on CPU because the outputs change after merging. This is unrelated to the PR, so let's just skip those tests for now.