-
Notifications
You must be signed in to change notification settings - Fork 31.3k
Stop inheriting tests! #42192
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
Stop inheriting tests! #42192
Conversation
|
run-slow: cohere2, granitemoehybrid |
|
This comment contains models: ["models/cohere2", "models/granitemoehybrid"] |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
Yes, I agree! Will check the changes but in principle yes |
CI Results✅ No failing test specific to this PR 🎉 ! |
ydshieh
left a comment
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.
As talked internally, putting
del xxxTest (the imported one)
at the end of the test file would work
But works for me if you want to go this current version.
Thank you!
|
@ydshieh using the |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: cohere2, granitemoehybrid |
When we import a
pytesttest class likeBambaModelTestinto another file to inherit from, this creates a reference to the parent class in the new file. When we runpytest new_file.py, both the new child test class and the parent class are run. This was causing thebambatests to be run in thegranitemoehybridtest file and thecoheretests to be run in thecohere2test fileThis PR copies the test code into the new file, replacing the overridden attributes and methods as required, so that there's no reference to the parent class anywhere.
cc @ydshieh