Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

test(cli): test_bold_accent_renders_styled_not_bare fails only when its file runs as a whole

Aperta
#309 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
cli, testing-qa

Direzione di ricerca

Start with the three pytest commands in the issue, then inspect the autouse fixture in tests/test_cli_theme.py:21 and module-level state in raven/cli/_theme.py. Compare the earlier tests in that file with test_bold_accent_renders_styled_not_bare to identify what is not restored. Done means the individual test and the full tests/test_cli_theme.py and tests/ runs pass with the truecolor accent preserved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

test_bold_accent_renders_styled_not_bare passes alone and fails when its file runs as a whole, so any full-suite run shows one red that has nothing to do with the change under test.

Reproducing

uv run pytest tests/test_cli_theme.py::test_bold_accent_renders_styled_not_bare   # passes
uv run pytest tests/test_cli_theme.py                                             # fails
uv run pytest tests/                                                              # fails

-p no:randomly does not change it, so this is not ordering randomisation.

What actually differs

AssertionError: expected bold + accent(#fbe23f) ANSI, got '\x1b[1;93mX\x1b[0m'
assert '1;38;2;251;226;63' in '\x1b[1;93mX\x1b[0m'

Worth noting what 93 is: bright yellow from the 8-colour palette. The test constructs its own Console(color_system="truecolor", force_terminal=True), so this is not the console degrading its colour depth -- it is emitting a named colour. The accent resolved to something like yellow rather than to #fbe23f, and Rich rendered the name.

So the leak is in the theme the console was handed, not in terminal detection.

Where to look

tests/test_cli_theme.py:21 has an autouse fixture that resets _theme._cache and clears RAVEN_THEME, RAVEN_TERM_BACKGROUND, COLORFGBG, CI, SSH_CONNECTION, SSH_TTY before each test, and nulls the cache again afterwards. Whatever survives between tests is therefore not one of those, and not the cache -- some other module-level state in raven/cli/_theme.py reached by an earlier test in the same file and never restored.

I did not narrow it to the specific test that leaves it behind.

Why it is worth fixing rather than tolerating

A permanently-red suite trains everyone to read 1 failed as normal, which is exactly when a real regression stops being visible. It also costs every contributor the same investigation -- confirming on a clean base that the red is pre-existing before they can trust their own run.

Found while verifying #308; unrelated to it and present on a clean main.

Lingua principale
Python
Stelle
4.1k
Fork
94
Merge medio
10h 2m
PR unite (30g)
376

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di EverMind-AI/Raven

Tutte le issue di EverMind-AI/Raven

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.