tests.sphinx.test_sphinx_matrix module

Tests for click_extra.sphinx.matrix.

Split in two halves: the dependency-light matrix-generation logic (git tag walking, spec parsing, floor filtering) and the matrix Sphinx directive that surfaces it. Both live under tests/sphinx/ because importing click_extra.sphinx.matrix pulls in the Sphinx package; the sibling conftest.py skips the whole tree when Sphinx or MyST-Parser is absent.

tests.sphinx.test_sphinx_matrix.pytestmark = MarkDecorator(mark=Mark(name='skipif', args=(False,), kwargs={'reason': 'matrix generation walks git tags, so the whole module needs a git binary'}))

Skip the module when git is missing, instead of failing every test.

The sibling conftest.py skips the tree when Sphinx or MyST-Parser is absent. Git is the third thing this module needs, and the only one that is a binary rather than an import, so that guard cannot cover it.

tests.sphinx.test_sphinx_matrix.MATRIX_MODULE = 'click_extra.sphinx.matrix'

Dotted path the PyPI lookup is patched through.

Importing the module object instead would put a matrix name in scope, and ruff would then read every {matrix} fence in the fixtures as an f-string.

tests.sphinx.test_sphinx_matrix.LABEL_DATE_RE = re.compile(' \\(\\d{4}-\\d{2}-\\d{2}\\)')

The first-release date a row label carries after its lower bound.

tests.sphinx.test_sphinx_matrix.WIDGET_CORNER = '`proj` ↴ \\\\ `widget` →'

Top-left cell of a proj table tracking widget, backslash escaped.

tests.sphinx.test_sphinx_matrix.offline_pypi(monkeypatch)[source]

Anchor every table on uv.lock, with no call to PyPI.

The fixtures track a made-up widget dependency, and a real project of that name on PyPI would move their columns. The tests of the PyPI anchor stub the lookup again with the releases they need.

Return type:

None

tests.sphinx.test_sphinx_matrix.unreadable_pypi(monkeypatch)[source]

Make every PyPI lookup fail, over the read offline_pypi stubs.

The lookup answers required the way the real one does: a required read raises, and any other read returns no release.

Return type:

None

tests.sphinx.test_sphinx_matrix.git_repo(path)[source]

Initialize a bare-bones git repository at path.

Returns a run(*args) helper executing commands in that working tree, so each fixture only spells out the commits and tags it cares about.

Return type:

Callable[..., None]

tests.sphinx.test_sphinx_matrix.dated_tag(repo, tag, date)[source]

Commit the working tree of repo on date and tag it tag.

The dates decide when a range was superseded, which the undeclared cells of both axes read.

Return type:

None

tests.sphinx.test_sphinx_matrix.declare_python(repo, spec, *classifiers)[source]

Write a pyproject.toml declaring requires-python and classifiers.

Return type:

None

tests.sphinx.test_sphinx_matrix.declare_widget(repo, spec)[source]

Write a pyproject.toml requiring widget{spec}.

Picks whichever dialect can express the range: Poetry’s caret and tilde are not valid PEP 508, so they only ever appear in Poetry’s own table.

Return type:

None

tests.sphinx.test_sphinx_matrix.named_repo(path, pyproject)[source]

Tag one release in a git repository at path, then leave pyproject as its working-tree pyproject.toml, or no such file for None.

The tagged file declares the Python support a matrix renders. The working-tree file is the one the default package label is read from.

Return type:

Path

tests.sphinx.test_sphinx_matrix.table_cells(line)[source]

Split one line of a rendered GFM matrix into its stripped cells.

Return type:

list[str]

tests.sphinx.test_sphinx_matrix.table_header(table)[source]

Return the header cells of a rendered GFM matrix, corner label first.

Return type:

list[str]

tests.sphinx.test_sphinx_matrix.tagged_table_rows(table)[source]

Parse a rendered GFM matrix into {row label: [cells…]}.

Lets a test assert a whole row at once (spec, then the full ✅ / ❌ vector) instead of probing the table for loose substrings. The key drops the first-release date of the label, since the fixtures tag their commits on the day the test runs.

Return type:

dict[str, list[str]]

tests.sphinx.test_sphinx_matrix.test_parse_python_spec(spec, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_versions_released_by_default_table()[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_versions_released_by_sorted_ascending()[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_versions_released_by_custom_table()[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_release_dates_shape()[source]

Every entry must be X.Y → ISO date string.

Return type:

None

tests.sphinx.test_sphinx_matrix.synthetic_repo(tmp_path)[source]

Build a tiny git repo with two tagged commits declaring different Python support sets, so python_matrix_groups sees an evolution.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_synthetic(synthetic_repo)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_returns_named_tuple(synthetic_repo)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_reads_a_tag_that_is_no_utf8(synthetic_repo)[source]

A tag name that does not decode as UTF-8 leaves the walk going.

The tag goes in packed-refs: a loose ref is a file, and APFS refuses a file name that is no UTF-8.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_no_tags(tmp_path)[source]

A repo with no matching tags returns an empty list.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_version_floor(synthetic_repo)[source]

version_floor drops release tags below the bare version.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_ceiling_honored(tmp_path)[source]

A declared <X.Y ceiling excludes those versions from ✅.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_keeps_declared_spec(synthetic_repo)[source]

Each group carries its raw requires-python next to the set it attests, since the two drive different cells.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_groups_respelled_floor_continues_range(tmp_path)[source]

Re-spelling a floor-only requires-python does not end its range.

The range lasts until 2.0.0, after Python 3.11 and 3.12 came out, so its capped support includes both. Split at the re-spelling, its older half would end in June 2022, before 3.11, and read 3.10 alone.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_range_labels(bounds, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_cell(version, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_cell_spec_shapes(spec, version, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_three_states(tmp_path)[source]

A release claiming less than its floor allows renders all three cells.

The classifiers stop at 3.11 while requires-python only rules out everything under 3.10, so 3.12 is neither supported nor forbidden.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_synthetic(synthetic_repo)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_show_date(synthetic_repo, show_date)[source]

show_date follows each row label with its first release date.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_column_order(synthetic_repo, column_order)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_row_order(synthetic_repo, row_order)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_invalid_order(synthetic_repo)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_python_floor(synthetic_repo)[source]

python_floor trims the low Python columns from the header.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_empty(tmp_path)[source]

An empty repo produces the empty string, matching the if not groups: return "" early exit.

Return type:

None

tests.sphinx.test_sphinx_matrix.split_floor_repo(tmp_path)[source]

A repo raising its Python floor in the 1.0.1 patch release.

The newest release supports 3.11 and later, and 1.0.0 only 3.9, so the support envelope starts at 1.0.1, inside the 1.0 minor series.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_envelope(split_floor_repo)[source]

The ranges below the oldest one supporting the floor or a later Python go.

The oldest columns, which no remaining range supports, go with them.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_python_matrix_table_full_history(split_floor_repo)[source]

The full history keeps every range and every column.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_matrix_directive_full_history_option(sphinx_app_myst, split_floor_repo, full_history)[source]

:full-history: keeps the releases the envelope leaves out.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_full_history_marker(split_floor_repo, tmp_path)[source]

The full-history marker flag keeps the releases the envelope drops.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_matrix_python_directive_renders_table(sphinx_app_myst, synthetic_repo)[source]

{matrix} python renders the generated table as a real <table>.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_matrix_python_directive_respects_floors(sphinx_app_myst, synthetic_repo)[source]

The hyphenated directive options map to the floor parameters.

tests.sphinx.test_sphinx_matrix.test_matrix_python_directive_order_options(sphinx_app_myst, synthetic_repo)[source]

The :column-order: / :row-order: options flip both axes.

tests.sphinx.test_sphinx_matrix.test_matrix_python_directive_no_tags_renders_nothing(sphinx_app_myst, tmp_path)[source]

A repository with no release tags yields no table (a build warning).

tests.sphinx.test_sphinx_matrix.test_matrix_python_directive_renders_embedded_table(sphinx_app_myst)[source]

An embedded table renders as a real <table> without any git access.

This is the self-updating steady state: the offline updater keeps the table in the source, and the build renders that copy verbatim.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_populates_empty_block(synthetic_repo, tmp_path)[source]

The updater fills an empty block, keeping options and surrounding text.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_idempotent(synthetic_repo, tmp_path)[source]

A second run over freshly written blocks reports no change.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_check_mode(synthetic_repo, tmp_path)[source]

check=True flags a stale block without writing to disk.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_leaves_bad_path_untouched(tmp_path)[source]

A block whose git generation fails is left byte-for-byte unchanged.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_keeps_other_line_separators(tmp_path)[source]

Prose holding a line separator other than a newline is copied verbatim.

A Unicode line separator splits a line for str.splitlines, not for a Markdown reader: a refresh writing it back as a newline would rewrite the page, and report it stale on every check.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_leaves_an_unreadable_pypi_untouched(synthetic_dep_repo, tmp_path, unreadable_pypi)[source]

An unreachable PyPI is a generation failure, not a stale block.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_skips_examples_nested_in_code_block(synthetic_repo, tmp_path)[source]

Matrix examples shown inside a longer code fence are never refreshed.

Both forms are documented illustrations here, not live blocks, even though their generation would succeed: the fence-aware walk copies them verbatim.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_refresh_directives_cli(synthetic_repo, tmp_path)[source]

click-extra refresh-directives refreshes in place; –check gates CI.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_refresh_directives_cli_without_sphinx(tmp_path, monkeypatch)[source]

The command fails gracefully (not a traceback) when sphinx is absent.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_to_specifier_set(spec, member, nonmember)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_to_specifier_set_unparsable(spec)[source]

An unparsable specifier yields None, which renders as an all-❌ row rather than raising out of the Sphinx build.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_to_specifier_set_empty_matches_everything()[source]

An empty specifier is the universal set, not None.

Unreachable through the matrix itself, since a tag with no declared requirement is skipped before this point.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_spec_identity(spec, other, expected)[source]

Two specifiers share an identity when they accept the same versions.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_spec_floor(spec, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_extract_requirement(declaration, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_extract_requirement_canonicalizes_name()[source]

PEP 503 name normalization decides the match, so a dependency spelled with any separator is found under any other spelling.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_extract_requirement_from_setup_py()[source]

A setup.py release has no tables to read, so its string literals are harvested and filtered by the same PEP 508 parse.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_cell(spec, version, released, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_cell_caps_later_majors(version, released, expected)[source]

A superseded range never attests a major newer than its cap.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_newest_major()[source]

The newest major out by a day, and none without a dated release.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_columns(rows, shown, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_envelope(rows, full_history, expected)[source]

Rows come oldest first, and columns run from the oldest version.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_column_candidates(specs, releases, locked, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_latest_locked_version(tmp_path, dep_name, expected)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_latest_locked_version_without_lockfile(tmp_path)[source]

A project with no uv.lock locks nothing, rather than failing.

Return type:

None

tests.sphinx.test_sphinx_matrix.stub_releases(monkeypatch, *versions, dates=None)[source]

Make PyPI list versions as the stable releases of every dependency.

A release is undated unless dates gives its ISO publication date, so a stub without dates never produces an undeclared cell.

Return type:

None

tests.sphinx.test_sphinx_matrix.synthetic_dep_repo(tmp_path)[source]

A git repo whose widget dependency floor evolves across two tags, exercising both minor-grouped and patch-split column derivation.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_groups(synthetic_dep_repo)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_group_keeps_its_released_fields()[source]

The four fields of 10.2.0 keep their positions, and build a group alone.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_columns_and_cells(synthetic_dep_repo, monkeypatch)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.exotic_spec_repo(tmp_path)[source]

A repo whose widget requirement takes a different exotic shape at every tag, so one render exercises the whole specifier vocabulary.

The caret tag also migrates the declaration from Poetry to PEP 621 and back, the way a real project’s history crosses packaging backends.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_exotic_specs(exotic_spec_repo, monkeypatch)[source]

Each specifier shape resolves to the right ✅ / ❌ vector.

The exclusion hole of >=4.0,!=4.1.* isolates 4.1.0, and the 2.1.0 release no range accepts keeps its column between two that some do. The full history keeps the ranges the support envelope would leave out.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_merges_equivalent_specs(tmp_path)[source]

Consecutive tags differing only in spelling form a single range.

Poetry’s ^2.0 and PEP 621’s >=2.0,<3.0.0 describe the same set, so they group into one range instead of two identical rows. This is what a packaging-backend migration looks like in the history.

Return type:

None

tests.sphinx.test_sphinx_matrix.narrowing_floor_repo(tmp_path)[source]

A repo whose widget floor narrows across three tags, locked at 4.0.0.

The caret range accepts 3.1 and the compatible-release range does not.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_merge_keeps_distinct_specs(tmp_path, monkeypatch, show_spec, expected)[source]

Ranges whose cells coincide merge, unless their specs differ.

Both ranges accept every release so far, and differ only above the newest one. A merged row shows the Spec cell of its oldest range, so merging them would claim <4 for releases that declared <5.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_bins_split_ranges(narrowing_floor_repo, monkeypatch)[source]

The releases between two floors tell the ranges apart on their cells.

Return type:

None

tests.sphinx.test_sphinx_matrix.pinned_widget_repo(tmp_path, name, spec)[source]

A one-tag repo pinning widget to spec, locked at 2.4.0.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_pinned_spec(tmp_path, monkeypatch, spec, columns, cells)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_lone_ceiling(tmp_path)[source]

A lone ceiling anchors no column of its own.

Unlike a pin, it has no lower bound to place, so the only column left is the locked version, which the ceiling genuinely forbids. The all-❌ row is the honest rendering here, not a missing column.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_suffixed_poetry_floor(tmp_path, monkeypatch)[source]

A Poetry caret on a post-release translates like any other caret.

Its floor keeps the suffix, so the release it follows falls out of range, and its ceiling ignores it, so the later 2.x release stays in.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_shows_a_release_ahead_of_the_lock(tmp_path, monkeypatch)[source]

A release newer than the locked one gets a column of its own.

The table shows it before the lockfile adopts it, here as a major no range accepts yet. The locked version counts even when PyPI does not list it.

Return type:

None

tests.sphinx.test_sphinx_matrix.WIDGET_DATES = {'1.0.0': '2023-12-01', '2.0.0': '2024-05-01', '2.1.0': '2024-06-10', '3.0.0': '2025-01-01'}

Publication dates of the widget releases the dated repository sees.

tests.sphinx.test_sphinx_matrix.dated_dep_repo(tmp_path)[source]

A repo raising its widget floor at each of three dated tags.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_undeclared_after_superseded(dated_dep_repo, monkeypatch)[source]

A release out after a range was superseded reads – for that range, though its specifier accepts it. So does a release of a major out after the last release of the range: 1.0.0 never met widget 2.x, and 2.0.0 never met widget 3.0.0.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_unmet_major_after_last_release(tmp_path, monkeypatch)[source]

A major out after the last release of a superseded range reads –.

widget 1.5.0 and 2.0.0 both come out after 1.1.0, the last release of the 1.x range, and before 2.0.0 supersedes it. Its open specifier accepts both, and the range met the 1.x major, so 1.5.0 reads ✅. No release of the range ever met 2.0.0.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_envelope(dated_dep_repo, monkeypatch)[source]

The envelope stops at the oldest range supporting the floor or later.

A range supports a dated release it accepts only when the release came out while the range was current, from a major out by its last release. Neither older range ever met widget 3.0.0, the floor of the newest range, so both go, and the columns only they accepted too.

Return type:

None

tests.sphinx.test_sphinx_matrix.ENVELOPE_WIDGET_DATES = {'1.0.0': '2021-12-01', '2.0.0': '2023-05-01', '3.0.0': '2024-12-01'}

Publication dates of the widget releases the envelope repository sees.

tests.sphinx.test_sphinx_matrix.envelope_repo(tmp_path)[source]

A repo declaring its Python support and a widget floor at each tag.

The Python envelope leaves out 1.0.0, which supports no Python from 3.11 on. The widget one keeps every release.

Return type:

Path

tests.sphinx.test_sphinx_matrix.test_envelope_list_across_axes(envelope_repo, monkeypatch)[source]

The release bound is the strictest one, and each version bound is read again over the releases left in scope.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_envelope_list_without_cut(synthetic_dep_repo)[source]

With no envelope leaving out a release, the list has no release bound. An axis the history never declares is skipped, and a version of unknown date gets no date.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_envelope_region(envelope_repo, tmp_path, monkeypatch)[source]

The refresh fills an envelope region between its markers, and settles.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_leaves_an_envelope_region_untouched(envelope_repo, tmp_path, unreadable_pypi, args)[source]

An unreadable PyPI, or a region naming no axis, rewrites nothing.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_groups_respelled_spec_continues_range(tmp_path, monkeypatch)[source]

A re-spelled specifier continues its range.

widget 1.5.0 came out after 1.1.0 re-spelled the specifier, while that range was still current, so it reads ✅ for the whole range. Split at the re-spelling, 1.0.0 would look superseded before 1.5.0 came out. The whole history keeps the range in the table, though it never met the 2.x major that the newest range floors.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_headers_read_in_column_order(synthetic_dep_repo, monkeypatch, column_order, expected)[source]

A header reads from the bound its neighbors continue: the newest one while the columns run newest first, the oldest one otherwise.

Return type:

None

tests.sphinx.test_sphinx_matrix.pypi(httpserver, monkeypatch)[source]

Serve PyPI’s JSON API from the local test server.

tests.sphinx.test_sphinx_matrix.test_pypi_releases(pypi)[source]

The lookup asks for the normalized name and sorts the releases.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_pypi_releases_dates(pypi)[source]

A release is dated by the first upload among its files not yanked.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_pypi_releases_discards(pypi, tag, files)[source]

Pre-releases, yanked or empty releases and invalid versions are dropped.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_pypi_releases_unreadable(pypi, body, status)[source]

An error or a malformed answer costs the columns, not the table.

A caller that cannot use the fallback columns hears about the failure.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_to_specifier_set_poetry_conformance(spec, bounds)[source]

Every Poetry range translates to the interval Poetry documents.

The 0.x caret is the one that matters in practice: Poetry caps it at the next minor, since a 0. release is allowed to break on every minor.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_to_specifier_set_poetry_bare_wildcard()[source]

Poetry’s bare * allows any version, so it has no bounds to check.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_show_date(synthetic_dep_repo, show_date)[source]

show_date dates the rows without changing how they merge.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_column_order(synthetic_dep_repo, column_order)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_row_order(synthetic_dep_repo, row_order)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_dependency_matrix_table_empty(tmp_path)[source]
Return type:

None

tests.sphinx.test_sphinx_matrix.test_matrix_dependency_directive_renders(sphinx_app_myst, synthetic_dep_repo)[source]

{matrix} <dep> renders the dependency matrix as a real <table>.

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_marker_form(synthetic_repo, tmp_path)[source]

The <!-- matrix AXIS opts --> comment form refreshes to a raw table.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_walk_tags_dates_an_annotated_tag(tmp_path)[source]

A tag’s date is its commit’s author date, through an annotated tag too.

The tag object of an annotated tag carries a tagger date of its own, which is not the one the row shows.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_reads_git_twice_per_refresh(synthetic_repo, tmp_path, monkeypatch)[source]

One refresh lists the tags and reads their files once, whatever the blocks.

Two pages carrying three blocks, with floors of their own, share the same history: the tag listing is one git for-each-ref and every tag’s files one git cat-file --batch.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_marker_order_options(synthetic_repo, tmp_path)[source]

column-order / row-order marker options flip the refreshed table.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_marker_show_date(synthetic_repo, tmp_path, flag)[source]

The show-date marker flag dates the refreshed rows.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_matrix_directive_show_date_option(sphinx_app_myst, synthetic_repo)[source]

The :show-date: directive option dates the rendered rows.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_marker_form_renders_natively_in_sphinx(sphinx_app_myst)[source]

A marker region’s raw table renders as a real <table> with no directive involved (so it renders on GitHub the same way).

Return type:

None

tests.sphinx.test_sphinx_matrix.test_resolve_root_relative_base_dir(synthetic_repo, monkeypatch)[source]

A relative base_dir still resolves to the real repo folder, so the default package label is never the empty Path(".").name.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_render_block_default_package_label(tmp_path, pyproject, options, expected)[source]

Without a package option, the label is the name the project declares in its pyproject.toml. The folder name is the fallback.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_label_ignores_checkout_name(tmp_path)[source]

A copy of a project under another folder name agrees with the table refreshed in the first checkout, so its check reports nothing stale.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_render_block_raises_without_git(tmp_path, monkeypatch)[source]

With git absent from PATH, generation raises an error the callers catch.

Return type:

None

tests.sphinx.test_sphinx_matrix.test_update_matrix_blocks_preserves_table_without_git(tmp_path, monkeypatch)[source]

Refreshing is non-destructive when git is unavailable: an embedded table stays put rather than being wiped by a failed regeneration.

tests.sphinx.test_sphinx_matrix.test_matrix_directive_renders_embedded_without_git(sphinx_app_myst, monkeypatch)[source]

A populated block renders at build time with no git on PATH: the shallow-clone / no-git CI case the embedded copy is designed for.