Skip to content

feat(cli): explain a --filter that matches nothing - #1238

Merged
Chemaclass merged 1 commit into
mainfrom
feat/filter-no-match-hint
Aug 14, 2026
Merged

Chemaclass merged 1 commit into
mainfrom
feat/filter-no-match-hint

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1237

The report prints a humanized title while --filter matches the function name, case-sensitively. Copying the name you just read therefore selects nothing, and the run ends on a bare No tests found with nowhere to go. The space is not required for this — test_alpha prints as Alpha, and --filter Alpha finds nothing either.

💡 Changes

  • An empty selection caused by --filter names the test it most likely meant, resolving both differences: lowercase the filter, and put underscores back where the humanized title shows spaces
  • With no plausible candidate it states the rule rather than guessing
  • Prints only when a filter was given, so an empty run for any other reason is byte-identical to before — that is what keeps the existing path snapshot valid, and two tests pin it
  • Covered in --parallel too: the summary renders in the parent, but that boundary has produced silent divergences in this project before (A @data_provider that yields no data makes the test vanish #1145, Duplicate test functions go undetected under --parallel #1147)

Only the filter is lowercased, never the candidate list, so there is no fork per function on a path that has already decided to run nothing.

The report prints a humanized title while --filter matches the function name,
case-sensitively, so copying the name just read selects nothing and the run
ends on a bare "No tests found". The space is not required for this: test_alpha
prints as "Alpha", and --filter Alpha finds nothing either.

The run knows the filter and every function it sourced, so it now names the
test it most likely meant, resolving both differences -- lowercase the filter,
and put underscores back where the title shows spaces. With no plausible
candidate it states the rule instead of guessing.

Prints only when a filter was given, so an empty run for any other reason is
byte-identical to before, which is what keeps the path snapshot valid. Only the
filter is lowercased, never the candidate list, so there is no fork per
function on a path that has already decided to run nothing. Covered in both
modes: the summary renders in the parent, but that boundary has produced silent
divergences here before.

Closes #1237
@Chemaclass Chemaclass added the enhancement New feature or request label Aug 14, 2026
@Chemaclass Chemaclass self-assigned this Aug 14, 2026
@Chemaclass
Chemaclass merged commit 95eb7a3 into main Aug 14, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the feat/filter-no-match-hint branch August 14, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant