-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix help sections for CLI options #13221
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
Conversation
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.
Looks great, thanks for the cleanup!
I think a "trivial" changelog is good to have, given this is a minor but still user facing change.
Before: pytest-warnings: -W, --pythonwarnings PYTHONWARNINGS Set which warnings to report, see -W option of Python itself --maxfail=num Exit after first num failures or errors --strict-config Any warnings encountered while parsing the `pytest` section of the configuration file raise errors --strict-markers Markers not registered in the `markers` section of the configuration file raise errors --strict (Deprecated) alias to --strict-markers -c, --config-file FILE Load configuration from `FILE` instead of trying to locate one of the implicit configuration files. --continue-on-collection-errors Force test execution even if collection errors occur --rootdir=ROOTDIR Define root directory for tests. Can be relative path: 'root_dir', './root_dir', 'root_dir/another_dir/'; absolute path: '/home/user/root_dir'; path with variables: '$HOME/root_dir'. But other than -W, those options aren't related to pytest-warnings at all. This is a regression in 19e99ab, which added `group = parser.getgroup("pytest-warnings")` in the middle of those "general" options, thus moving the help section for some of them.
Moves --continue-on-collection-errors to "collection:"
"test session [...] configuration" seems more fitting than "general"
The only differences between the two is that: - `addoption` checks for conflicts, but `_addoption` does not - `addoption` complains if a lower-case short option is given, `_addoption` does not Yet it looks like using the latter has been inconsistently cargo-culted with newer options.
815c4c5
to
174333e
Compare
Added changelog and rebased (no other changes). We don't have a Any opinions on whether to backport this (IMHO yes), and whether to squash-merge (IMHO no)? |
IMHO no, I prefer to stick to docs-only and bugs-only for patch releases -- although this could be considered "doc", is still output from running pytest, who knows who might be parsing this and possibly breaking due to it changing? But I understand this is really low risk, so is not a strong stance, so please go ahead if you would like to see this in the next patch release.
Agreed! |
Backport to 8.3.x: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply b0caf3d on top of patchback/backports/8.3.x/b0caf3d7adc45f773177424593431869fd2f82d8/pr-13221 Backporting merged PR #13221 into main
🤖 @patchback |
Whoops, I agree with what you said but forgot I already put the backport label on. Let's just leave it un-backported, given that nobody noticed the bugfix part for almost 4.5 years, I'm not in a hurry. 😅 |
Probably best reviewed commit by commit. Notably, this fixes:
which makes no sense for anything except the first option, and is a regression in 19e99ab.
Other than that, it moves:
--continue-on-collection-errors
to "collection" rather than "general"--config-file
and--rootdir
to "test session [...] configuration" (where we also have things like--basetemp
and--override-ini
) instead of "general"Finally, it cleans up incorrectly cargo-culted usage of
group._addoption
instead ofgroup.addoption
.Not sure if this needs a changelog?