Skip to content

test(diagnostics): cover warning retention and reset behavior - #121

Open
glenlouis8 wants to merge 1 commit into
pythonnative:mainfrom
glenlouis8:test/diagnostics-warning-log
Open

glenlouis8 wants to merge 1 commit into
pythonnative:mainfrom
glenlouis8:test/diagnostics-warning-log

Conversation

@glenlouis8

Copy link
Copy Markdown
Contributor

Closes #94

Extends the diagnostics-primitives section of tests/test_core_semantics.py using the existing dev_mode fixture and capsys.

Covers:

  • the warning log keeps the newest 200 messages in oldest-first order (201 recorded, first one evicted)
  • mutating the list returned by get_warnings() doesn't change the internal log
  • clear_warnings() empties the log and lets a used warn_once key emit again
  • warn_once() without a key dedupes by message, and different messages stay distinct
  • warn_once() in production mode doesn't consume its key, so it still emits after dev mode is enabled

Test-only change. ./scripts/check.sh passes.

@glenlouis8

Copy link
Copy Markdown
Contributor Author

The Wheels (macos-14) job was cancelled after about 20 minutes without getting a runner, so it looks like a runner queue timeout rather than a failure from this change (it only touches tests/test_core_semantics.py). Everything else passes. I can't rerun it without admin rights, so could a maintainer re-run the failed job? Thanks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover diagnostic warning retention and reset behavior with tests

1 participant