improve test id for consistency tests#6763
Merged
pmeier merged 2 commits intopytorch:mainfrom Oct 13, 2022
Merged
Conversation
pmeier
commented
Oct 13, 2022
| [ | ||
| pytest.param(config, args_kwargs, id=f"{config.legacy_cls.__name__}({args_kwargs})") | ||
| pytest.param( | ||
| config, args_kwargs, id=f"{config.legacy_cls.__name__}-{idx:0{len(str(len(config.args_kwargs)))}d}" |
Contributor
Author
There was a problem hiding this comment.
The numerical id looks weird, but this actually makes sense. As implemented, we always get a zero-padded number depending on the number of runs. For example, test_call_consistency[RandomCrop-00] vs. test_call_consistency[RandomCrop-0]. Although this seems minor, without this, it is impossible to select the 0th test with -k 0 while at the same time pulling in test_call_consistency[RandomCrop-10] or any other test that also includes a 0 in its id. With this change you can do -k00 to select only the one test you want.
facebook-github-bot
pushed a commit
that referenced
this pull request
Oct 17, 2022
Reviewed By: NicolasHug Differential Revision: D40427475 fbshipit-source-id: 209a4b7af54d80fbaf0ca4bc7e1a91bea6f028a0
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.
As requested by @vfdev-5 offline. In the past the
ArgsKwargsobject implemented a__repr__method, so the old id made sense at the time.