Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Closed
#309 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
cli, testing-qa

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
4.1k
Forks
94
Avg merge
14h 44m
Merged PRs (30d)
420

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EverMind-AI/Raven

All issues in EverMind-AI/Raven

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.