Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Click Extra has been maintained for 5+ years, and is free to use. You can help if you 🤝 purchase business support or 🫶 sponsor the project.
Click Extra
Light Logo Dark Logo
  • Installation
  • Tutorial

Running and wrapping CLIs

  • CLI
  • Man pages
  • CLI wrapper

Building a CLI

  • Commands & groups
  • Decorators
  • Types
  • Context
  • Multicall binaries

Configuration

  • Configuration files
  • Configuration discovery
  • Configuration formats
  • Configuration schema
  • Configuration validation
  • Environment variables

Colors and output

  • Colored help
  • Themes
  • Styling
  • Layout
  • Table
  • Spinner

Runtime behavior

  • Logging
  • Execution
  • Version
  • Bug reports
  • Telemetry

Introspection and export

  • Parameters
  • Machine-readable help
  • Command tree
  • Carapace completion

Testing

  • CLI testing
  • Pytest
  • Test suites

Terminal captures

  • CLI screenshots
  • Code snippets
  • Man-page

Documenting a CLI

  • Sphinx
  • Python directives
  • MyST docstrings
  • Pygments
  • MkDocs

Comparisons

  • Typer compatibility
  • Benchmark

Contributing

  • Contribution guide
  • Downstream packaging
  • Binaries
  • Upstream
  • Code of conduct

API reference

  • click_extra package
    • click_extra.capture package
      • click_extra.capture.html module
      • click_extra.capture.presets module
      • click_extra.capture.recording module
      • click_extra.capture.screenshot module
      • click_extra.capture.snippet module
      • click_extra.capture.svg module
      • click_extra.capture.terminal module
    • click_extra.config package
      • click_extra.config.builtin module
      • click_extra.config.discovery module
      • click_extra.config.export module
      • click_extra.config.flags module
      • click_extra.config.formats module
      • click_extra.config.option module
      • click_extra.config.schema module
      • click_extra.config.subcommands module
    • click_extra.markdown package
      • click_extra.markdown.blocks module
      • click_extra.markdown.myst module
    • click_extra.sphinx package
      • click_extra.sphinx.announcement module
      • click_extra.sphinx.changelog module
      • click_extra.sphinx.click module
      • click_extra.sphinx.click_reference module
      • click_extra.sphinx.click_runner module
      • click_extra.sphinx.crosshair module
      • click_extra.sphinx.doctrees module
      • click_extra.sphinx.fail_on_warnings module
      • click_extra.sphinx.linkcheck module
      • click_extra.sphinx.manpages module
      • click_extra.sphinx.matrix module
      • click_extra.sphinx.mermaid module
      • click_extra.sphinx.myst_docstrings module
      • click_extra.sphinx.opengraph module
      • click_extra.sphinx.python module
      • click_extra.sphinx.tables module
      • click_extra.sphinx.tabs module
      • click_extra.sphinx.theme_docs module
      • click_extra.sphinx.todos module
      • click_extra.sphinx.viewcode module
    • click_extra.accessibility module
    • click_extra.ansi module
    • click_extra.blocks module
    • click_extra.bug_report module
    • click_extra.carapace module
    • click_extra.cli module
    • click_extra.cli_capture module
    • click_extra.cli_prebake module
    • click_extra.cli_wrapper module
    • click_extra.color module
    • click_extra.columns module
    • click_extra.command_doc module
    • click_extra.commands module
    • click_extra.context module
    • click_extra.decorators module
    • click_extra.envvar module
    • click_extra.execution module
    • click_extra.highlight module
    • click_extra.humanize module
    • click_extra.jobs module
    • click_extra.layout module
    • click_extra.logging module
    • click_extra.logo module
    • click_extra.mkdocs module
    • click_extra.multicall module
    • click_extra.output module
    • click_extra.param_tools module
    • click_extra.parameters module
    • click_extra.prebake module
    • click_extra.progress module
    • click_extra.project module
    • click_extra.pygments module
    • click_extra.pytest module
    • click_extra.show_params module
    • click_extra.spinner module
    • click_extra.spinner_presets module
    • click_extra.styling module
    • click_extra.table module
    • click_extra.table_options module
    • click_extra.telemetry module
    • click_extra.test_suite module
    • click_extra.testing module
    • click_extra.theme module
    • click_extra.trail module
    • click_extra.tree module
    • click_extra.types module
    • click_extra.version module
    • click_extra.version_facts module
  • tests package
    • tests.mkdocs package
      • tests.mkdocs.conftest module
      • tests.mkdocs.test_mkdocs module
    • tests.sphinx package
      • tests.sphinx.conftest module
      • tests.sphinx.test_sphinx module
      • tests.sphinx.test_sphinx_announcement module
      • tests.sphinx.test_sphinx_changelog module
      • tests.sphinx.test_sphinx_click module
      • tests.sphinx.test_sphinx_click_config module
      • tests.sphinx.test_sphinx_click_tree module
      • tests.sphinx.test_sphinx_crosshair module
      • tests.sphinx.test_sphinx_doctrees module
      • tests.sphinx.test_sphinx_fail_on_warnings module
      • tests.sphinx.test_sphinx_linkcheck module
      • tests.sphinx.test_sphinx_manpages module
      • tests.sphinx.test_sphinx_matrix module
      • tests.sphinx.test_sphinx_mermaid module
      • tests.sphinx.test_sphinx_myst_docstrings module
      • tests.sphinx.test_sphinx_opengraph module
      • tests.sphinx.test_sphinx_python module
      • tests.sphinx.test_sphinx_tables module
      • tests.sphinx.test_sphinx_tabs module
      • tests.sphinx.test_sphinx_todos module
      • tests.sphinx.test_sphinx_viewcode module
    • tests.conftest module
    • tests.tachyon_cast module
    • tests.test_accessibility module
    • tests.test_ansi module
    • tests.test_blocks module
    • tests.test_bug_report module
    • tests.test_carapace module
    • tests.test_cli_wrapper module
    • tests.test_color module
    • tests.test_command_doc module
    • tests.test_commands module
    • tests.test_config module
    • tests.test_config_discovery module
    • tests.test_config_flags module
    • tests.test_config_schema module
    • tests.test_context module
    • tests.test_docs_anchors module
    • tests.test_docs_api module
    • tests.test_docs_directives module
    • tests.test_envvar module
    • tests.test_execution module
    • tests.test_highlight module
    • tests.test_humanize module
    • tests.test_hygiene module
    • tests.test_jobs module
    • tests.test_layout module
    • tests.test_logging module
    • tests.test_logo module
    • tests.test_multicall module
    • tests.test_myst module
    • tests.test_output module
    • tests.test_parameters module
    • tests.test_prebake module
    • tests.test_progress module
    • tests.test_project module
    • tests.test_pygments module
    • tests.test_pyproject module
    • tests.test_pytest module
    • tests.test_readme module
    • tests.test_recording module
    • tests.test_screenshots module
    • tests.test_snippet module
    • tests.test_sphinx_crossrefs module
    • tests.test_spinner module
    • tests.test_styling module
    • tests.test_table module
    • tests.test_telemetry module
    • tests.test_terminal module
    • tests.test_test_suite module
    • tests.test_testing module
    • tests.test_theme module
    • tests.test_trail module
    • tests.test_tree module
    • tests.test_types module
    • tests.test_utils module
    • tests.test_version module
  • Index
  • Module Index

Project

  • Changelog
  • Todo list
  • License
  • GitHub repository
  • Funding
Back to top
View this page
Edit this page

tests.test_logo module¶

Test the terminal rendition of the Click Extra brand mark.

The layout it is drawn into belongs to VersionScreen and is tested in test_version.py. What is checked here is the mark itself: that its geometry lands on the grid, that its palette follows the system it claims to, and that both survive the terminal.

tests.test_logo.SILHOUETTE_FLOOR = 2.0¶

Contrast a face must keep against either background to hold its silhouette.

Below the 3:1 WCAG asks of non-text graphics, deliberately: that threshold assumes a shape whose only cue is its edge against the page, and this one also has two neighbouring planes to be read against. What it rules out is a face disappearing.

tests.test_logo.contrast(a, b)[source]¶
Return type:

float

tests.test_logo.rgb(value)[source]¶
Return type:

tuple[int, int, int]

tests.test_logo.ARTWORK = PosixPath('/home/runner/work/click-extra/click-extra/docs/assets/logo-square.svg')¶

The SVG the terminal rendition shares its palette with.

Present in a source checkout and in the sdist, absent from the wheel, which is the whole reason click_extra.logo repeats the colors instead of reading them.

tests.test_logo.PLANE_NAMES = {'left': 'l', 'right': 'r', 'top': 't'}¶

How the artwork’s CSS spells the planes click_extra.logo keys by initial.

tests.test_logo.test_palette_matches_the_artwork()[source]¶

The terminal mark and the artwork paint the same eighteen colors.

Both are flat-shaded, so nothing calls for two palettes, and nothing but this notices when one is recolored alone.

tests.test_logo.test_geometry_lands_on_whole_sub_pixels()[source]¶

Every vertex is an integer, so the fill has nothing to round.

A polygon landing between sub-pixels is what turns a straight edge into an irregular stair, and no amount of resolution fixes it.

tests.test_logo.test_edges_advance_two_sub_pixels_per_row()[source]¶

The lid edges are 2:1, which is the whole reason for the projection.

The artwork is a true 30-degree isometric, whose edges advance 1.732 sub-pixels per row. No grid holds that, so it comes out as a stair of alternating two- and four-wide treads that reads as fraying. Two across per one down tiles exactly.

tests.test_logo.test_rows_are_seated_not_floating()[source]¶

A cube rests on the two below it, rather than hovering over them.

The artwork’s own row pitch is wider than a stack allows, which shows the background between the rows. A cube meets the pair beneath it where their lids meet, exactly half a lid below their rims.

tests.test_logo.test_mark_fits_its_declared_box()[source]¶

Every line is exactly as wide as declared, trailing blanks included.

tests.test_logo.test_palette_follows_its_derivation()[source]¶

Every face sits at its cube’s hue and its plane’s luminance.

The palette is written out rather than computed, so it stays greppable and a designer can tune one value. Nothing but this notices a tuned value drifting off the system it claims to belong to.

tests.test_logo.test_every_cube_shows_exactly_its_three_faces()[source]¶

The grid carries the eighteen declared colors and nothing between them.

Rasterizing the mark and reading pixels back would let the antialiaser mint colors belonging to no face, over a hundred of them at this size. Hit-testing the polygons is what keeps the count to what the palette declares.

tests.test_logo.test_mark_keeps_its_distance_from_both_backgrounds(background)[source]¶

One palette has to serve a light terminal and a dark one.

Flat faces are what make that possible: the shape lives in the difference between a cube’s three planes, so only the silhouette has to clear the background, and that fits in the middle of the range.

tests.test_logo.test_neighbouring_faces_survive_a_256_color_terminal()[source]¶

No two faces that touch collapse onto the same palette index.

The mark is emitted in 24-bit color, so a terminal that downsamples is the degraded case rather than the target. It still has to show six cubes.

tests.test_logo.SCREEN_DEPENDENCIES_ARE_RELEASES = True¶

Whether the dependencies the version screen names are installed releases.

The screen’s Built on row prints the installed Click and Cloup versions, so a branch build widens it past the docs URL that is otherwise the longest row. The width below is a design constraint on the configuration this project ships, and the screen already falls back to the plain message when it does not fit, so asserting it against a dev string measures upstream’s version scheme rather than this package.

tests.test_logo.test_screen_fits_an_eighty_column_terminal()[source]¶

The mark is sized so the screen it decorates can actually be drawn.

A wider mark is not a bigger logo, it is no logo: the screen measures itself against the terminal and falls back to the plain message when it does not fit.

tests.test_logo.test_mark_is_painted_on_demand_and_once()[source]¶

The screen holds the painter, not the painting, and the painter caches.

Importing the module costs no rasterization: the mark is painted by the first --version that draws the screen, and every later draw reads it back.

Next
tests.test_multicall module
Previous
tests.test_logging module
Copyright © Kevin Deldycke and contributors
Made with Furo
Last updated on 2026-11-26
On this page
  • tests.test_logo module
    • SILHOUETTE_FLOOR
    • contrast()
    • rgb()
    • ARTWORK
    • PLANE_NAMES
    • test_palette_matches_the_artwork()
    • test_geometry_lands_on_whole_sub_pixels()
    • test_edges_advance_two_sub_pixels_per_row()
    • test_rows_are_seated_not_floating()
    • test_mark_fits_its_declared_box()
    • test_palette_follows_its_derivation()
    • test_every_cube_shows_exactly_its_three_faces()
    • test_mark_keeps_its_distance_from_both_backgrounds()
    • test_neighbouring_faces_survive_a_256_color_terminal()
    • SCREEN_DEPENDENCIES_ARE_RELEASES
    • test_screen_fits_an_eighty_column_terminal()
    • test_mark_is_painted_on_demand_and_once()