Skip to content

Reset marker config during unconfigure#868

Merged
tobiasraabe merged 1 commit intomainfrom
codex/reset-marker-config-unconfigure
Apr 26, 2026
Merged

Reset marker config during unconfigure#868
tobiasraabe merged 1 commit intomainfrom
codex/reset-marker-config-unconfigure

Conversation

@tobiasraabe
Copy link
Copy Markdown
Member

Summary

Reset the global marker generator configuration when pytask unconfigures so process-local strict marker settings cannot affect later marker access.

Root Cause

pytask_parse_config() stores the active config on the singleton MARK_GEN. A run using --strict-markers left that config attached after pytask_unconfigure(), so later code in the same process could treat unknown markers as strict errors instead of warning.

Changes

  • Add a marker plugin pytask_unconfigure() hook that clears MARK_GEN.config.
  • Add a regression test that runs a strict-marker failure before accessing an unknown marker through pytask.mark.
  • Document the fix in CHANGELOG.md.

Validation

uv run --group test pytest tests/test_mark.py::test_error_with_unknown_marker_and_strict tests/test_mark_structures.py::test_aliases tests/test_mark.py::test_strict_markers_do_not_leak_after_unconfigure -q

@tobiasraabe tobiasraabe force-pushed the codex/reset-marker-config-unconfigure branch from 02dd633 to dccf1f9 Compare April 26, 2026 15:41
@tobiasraabe tobiasraabe changed the title [codex] Reset marker config during unconfigure Reset marker config during unconfigure Apr 26, 2026
@tobiasraabe tobiasraabe marked this pull request as ready for review April 26, 2026 18:28
@tobiasraabe tobiasraabe added this pull request to the merge queue Apr 26, 2026
Merged via the queue into main with commit d644e5e Apr 26, 2026
23 checks passed
@tobiasraabe tobiasraabe deleted the codex/reset-marker-config-unconfigure branch April 26, 2026 18:34
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.

1 participant