Open
Conversation
These directories are Sphinx fixture projects, not importable package code. - Both tests/roots/test-altairplot/conf.py and tests/roots/test-altairplot-filearg/conf.py are top-level conf.py files. - When mypy walks tests, it maps both to the same module name (conf) and raises Duplicate module named "conf". - These files are test data for Sphinx builds (integration fixtures), so type-checking them adds little value compared to checking sphinxext_altair/ and actual test modules. So the exclude avoids a structural false-positive from fixture layout, not a real typing bug.
…nly when option is present
- The original `**{"chart-var-name": ...}` likely existed because chart-var-name contains a hyphen, so it cannot be passed as a normal keyword argument.
- New behavior: create node first, then only set plot_node["chart-var-name"] when user provided that option.
- Downstream code uses node.get("chart-var-name", None), so behavior is effectively the same for runtime logic.
Why the old assertions were brittle: - They asserted giant exact HTML blobs (including whitespace, token spans, and exact Vega-Lite schema URL string). - Those details are affected by upstream tooling changes: - Sphinx/Pygments changed tokenized output (<span class="w"> spacing, etc.) - Altair schema string changed from v5.20.1 to v6.1.0 - So tests failed even though core behavior (plot rendered, options respected) was still correct. New approach: 1. Parse HTML and assert DOM structure (order/sections/classes) instead of raw substrings. 2. Regex-match the embedded spec/actions blocks (strict on keys/values, loose on whitespace/order). 3. Keep one small “golden” snippet for critical template output, not entire page chunks.
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.
No description provided.