Inaccurate filename due to test class metaprogramming that doesn't set __file__ and __name__ #125467
Labels
module: devx
Related to PyTorch contribution experience (HUD, pytorchbot)
module: tests
Issues related to tests (not the torch.testing module)
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃悰 Describe the bug
I noticed that occasionally the "To execute this test" doesn't have complete information. For example:
but sometimes you just having testing.py, you don't even have a useful name.
This is usually always because the
__file__
on the test class is not set appropriately.Here is a sample fix diff:
we have to apply these to all test metaprograms. Maybe we can have a test to check
__file__
is actually set. Note that setting__file__
to__file__
is not always the right thing to do.Versions
main
cc @mruberry @ZainRizvi @kit1980 @huydhn @clee2000
The text was updated successfully, but these errors were encountered: