Chore: register the unmute_click pytest marker (Part 2/2) - #52
Open
AmaadMartin wants to merge 1 commit into
Open
Conversation
`tests/unittests/cli/utils/test_cli_tools_click.py` applies `@pytest.mark.unmute_click` nine times, and its autouse `_mute_click` fixture reads it, but the marker was never registered. Every run emitted nine `PytestUnknownMarkWarning`s. Register it in the existing `[tool.pytest]` table. This only affects pytest's warning output; `--strict-markers` stays off, so no previously-passing test can start failing.
This was referenced Jul 30, 2026
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
Closes: #issue_number
Related: #issue_number
Problem:
tests/unittests/cli/utils/test_cli_tools_click.pyapplies@pytest.mark.unmute_clicknine times (L1640, L1696, L1732, L1766, L1800,L1837, L1867, L1911, L1949), and its autouse
_mute_clickfixture reads it atL83-L86 to let a test opt out of the
click.echomute. The marker is registerednowhere, so every run of that file emits nine warnings:
Solution: Register the marker in the existing
[tool.pytest]table inpyproject.toml, keeping the dottedini_options.*key style already usedthere. This is the canonical one-key fix — no
conftest.pypytest_configurehook, no new file.
No other marker in the repo is registered, so this introduces the
markerskeyfor the first time; it is purely additive. It does not enable
--strict-markers, so it cannot make a previously-passing test fail — the onlyobservable effect is pytest's warning output.
Key placement (after
ini_options.testpaths, before theasyncio_*keys) iswhat
pyproject-fmt2.24.0 — the version pinned in.pre-commit-config.yaml—requires;
pyproject-fmt --check pyproject.tomlreportsno change.Stacking: this is part 2 of 2, based on
fix/telemetry-cli-no-subcommand-exit-code-assertion(#51), which fixes a staleexit-code assertion in the same test file. The two were split on review because
they are independent concerns: the nine marker usages and the
_mute_clickfixture both pre-date either branch (added in
6bab08fc), so this registrationstands on its own. It is stacked rather than parallel only so its CI reflects a
tree where the sibling failure is already fixed.
Collision check: ran
gh pr list --state open --limit 100on this fork (48open PRs) and diffed the file lists of every plausibly adjacent one. Three
(#17, #25, #31) touch
pyproject.toml, but their hunks are dependency additionsand a
[tool.codespell]table — none registers pytest markers or touches[tool.pytest]. No collision.Testing Plan
Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.
Unit Tests:
[x] I have added or updated unit tests for my change.
[x] All unit tests pass locally.
This is a pytest configuration change and adds no production line, so it has no
new code to cover. It is verified by the existing suite plus a direct check that
the warning is gone.
Run locally on the exact pushed commit (Python 3.13,
uv sync --extra test->click==8.4.2):Proving the change is load-bearing. Making the warning an error turns the
registration into a pass/fail gate, and the branch was run both with and without
the hunk:
ini_options.markershunk52 passedgit stash push pyproject.toml)ERROR ... pytest.PytestUnknownMarkWarning/Interrupted: 1 error during collectionLint checks run locally against the changed file, at the pinned
.pre-commit-config.yamlversions:Manual End-to-End (E2E) Tests:
Please provide instructions on how to manually test your changes, including any necessary setup or configuration.
The marker still functions —
test_telemetry_first_run_prompt_opt_inand itssiblings assert on prompt text that is only visible because
_mute_clickhonours the marker and skips the
click.echopatch. Those assertions pass, soregistration did not change the marker's behaviour.
Expected CI status: absent, validated locally instead. The workflow triggers
on
pull_request: branches: [main, v1](
.github/workflows/continuous-integration.yml:25-31), and this PR's base isfix/telemetry-cli-no-subcommand-exit-code-assertion, so no test job will run.The commands and results recorded above were run on the exact pushed commit.
For reference, the
Pre-commit Linterjob also fails on this fork for apre-existing, unrelated reason — the
update-constraintshook errors withResolution failed even without constraintson every PR, including ones thattouch no
pyproject.toml(e.g. #45).Checklist
[x] I have read the CONTRIBUTING.md document.
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.