Custom runners for non-Python code fences #67
Open
aaazzam wants to merge 7 commits into
Open
Conversation
Custom runners previously had only fixture names as a per-fence metadata channel, forcing consumers to declare placeholder pytest fixtures for flags whose values are never used. Expose the full set of fence options (info-string options plus mdx-comment metadata) as an `options` frozenset on FenceTestDefinition so runners can define their own flags. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #66 by making custom runners usable for non-Python fences.
It does so by adding two opt-in paths:
runner:<name>now collects any fence language with the named registered runner.register_runner(default_for=(...))registers a runner as the default for specific fence languages.Custom runners were always available a la (1) above, but only for python-based fences. Adding more opt-in paths of course adds marginal complexity to the runner selection precedence, which this PR makes:
runner:<name>on the fence.default_for.This PR enables us to do things like:
which sets a global default for
jsandjavascriptfenceswhile allowing per-fence customizeability
Also exposes all fence options (info-string options plus mdx-comment metadata) as an
options: frozensetfield onFenceTestDefinition, so custom runners can define their own per-fence flags without declaring a placeholder pytest fixture for each one.