Skip to content

Conversation

@Rocketknight1
Copy link
Member

@Rocketknight1 Rocketknight1 commented Nov 13, 2025

When we import a pytest test class like BambaModelTest into another file to inherit from, this creates a reference to the parent class in the new file. When we run pytest new_file.py, both the new child test class and the parent class are run. This was causing the bamba tests to be run in the granitemoehybrid test file and the cohere tests to be run in the cohere2 test file

This 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

@Rocketknight1 Rocketknight1 marked this pull request as ready for review November 13, 2025 18:28
@Rocketknight1
Copy link
Member Author

run-slow: cohere2, granitemoehybrid

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ["models/cohere2", "models/granitemoehybrid"]
quantizations: []

@HuggingFaceDocBuilderDev

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.

@ydshieh
Copy link
Collaborator

ydshieh commented Nov 13, 2025

Yes, I agree! Will check the changes but in principle yes

@github-actions
Copy link
Contributor

CI Results

Workflow Run ⚙️

✅ No failing test specific to this PR 🎉 !

Copy link
Collaborator

@ydshieh ydshieh left a 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!

@Rocketknight1
Copy link
Member Author

@ydshieh using the del solution instead, since it's a lot simpler

@Rocketknight1 Rocketknight1 enabled auto-merge (squash) November 14, 2025 13:59
@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: cohere2, granitemoehybrid

@Rocketknight1 Rocketknight1 merged commit c01e711 into main Nov 14, 2025
18 checks passed
@Rocketknight1 Rocketknight1 deleted the stop_inheriting_tests branch November 14, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants