rtk-ai/rtk

rtk pytest --version returns 'no tests collected' — wrapper consumes the flag

Open

#2.096 geöffnet am 26. Mai 2026

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:clibuggood first issuepriority:medium

Repository-Metriken

Stars
 (48.085 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T 17h) (49 gemergte PRs in 30 T)

Beschreibung

Summary

rtk pytest --version returns RTK's "no tests collected" filter output instead of pytest's version string. The wrapper consumes --version before forwarding to pytest.

Environment

  • rtk 0.42.0 (Homebrew, installed 2026-05-24)
  • macOS Darwin 24.6.0 (x86_64)
  • pytest installed in venv (verified works directly)

Repro

$ rtk pytest --version
Pytest: No tests collected

$ pytest --version
pytest 8.x.y

Expected

Forward --version to pytest, get pytest's normal pytest X.Y.Z output back.

Actual

The wrapper treats --version as a no-tests-specified RTK-level signal and runs pytest with no args, producing "no tests collected" — which RTK then formats as "Pytest: No tests collected". The actual --version query never reaches pytest.

Scope

--version is the obvious one; may also affect other passthrough flags pytest understands but the wrapper doesn't explicitly own. --help, --co, --collect-only, etc. worth checking.

Suggested fix

The pytest wrapper should pass through any flag it doesn't explicitly own to pytest unchanged. Reserve filter behavior for invocations where actual test args are provided.

Workaround

Run pytest --version directly (bypassing RTK), or use rtk run pytest --version (raw passthrough).

Contributor Guide