Repository navigation
test: make colour tests independent of an ambient NO_COLOR (#34) #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| """Test-session setup shared by the rege test suite. | ||
|
|
||
| ``rege.formatting`` reads ``NO_COLOR`` once at import time and blanks every | ||
| ``Colors`` attribute when it is set. Agent harnesses and many CI shells export | ||
| ``NO_COLOR=1``, which made the colour tests fail depending on the caller's | ||
| environment rather than the code (issue #34). Clear it before any test module | ||
| imports ``rege.formatting``; tests that exercise the NO_COLOR path set it | ||
| themselves with ``monkeypatch``/``patch.dict``. | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| os.environ.pop("NO_COLOR", None) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ Low · Change lacks narrative counterpart When this PR adds test-suite setup without a Add a corresponding update to the narrative record in Prompt for AI agentsIn `rege/tests/conftest.py` at line 13:
**Change lacks narrative counterpart**
When this PR adds test-suite setup without a `docs/logos/` update, the added test-session environment change has no corresponding entry in `docs/logos/`, so the required narrative record omits this change.
Add a corresponding update to the narrative record in `docs/logos/`.From Nature demands a documentation counterpart. This formation maintains its narrative record in `docs/logos/`.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Verify module-state isolation The issue asks to reproduce the Colors tests individually and after tests that disable colors before attributing the failures. This setup clears ambient NO_COLOR, but the receipt does not establish whether order-dependent module-state failures persist. Prompt for AI agentsIn `rege/tests/conftest.py` at line 13:
**Verify module-state isolation**
The issue asks to reproduce the Colors tests individually and after tests that disable colors before attributing the failures. This setup clears ambient NO_COLOR, but the receipt does not establish whether order-dependent module-state failures persist.From #34: Reproduce the Colors tests individually and after tests that disable colors; make isolation deterministic only if the defect persists. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium · Caller loses its colour setting
When pytest is invoked with
pytest.main()in a long-lived process whose environment hasNO_COLORset,os.environ.popremoves the caller’sNO_COLORin the pytest host process, and this conftest has no teardown to restore it, so subsequent application output in that process includes ANSI colours.Save the original value and restore it in a pytest session teardown hook.
Prompt for AI agents