Skip to main content

Minimalist visual regression testing helpers

Project description

tinyvdiff

PyPI version Python versions PyPI Downloads License

Minimalist visual regression testing helpers.

Installation

You can install tinyvdiff from PyPI:

pip3 install tinyvdiff

Or install the development version from GitHub:

git clone https://github.com/nanxstats/tinyvdiff.git
cd tinyvdiff
python3 -m pip install -e .

Why tinyvdiff?

Designing a visual regression testing framework involves balancing several competing challenges, particularly when it comes to the snapshot file format used for comparisons. The ideal format must meet three seemingly conflicting criteria:

  1. Support for diverse input types: Graphics and documents are often generated using different tools and formats (for example, PNG and PDF), making direct comparisons difficult.
  2. Bitwise reproducibility in plain text: The format should capture the precise appearance of the output while being deterministic and easy to inspect visually.
  3. Platform independence: Subtle differences in system fonts or dependencies can lead to inconsistent outputs across environments, yet the format should produce visually identical results on any system.

tinyvdiff takes a pragmatic approach by relaxing the third criterion and making reasonable assumptions about the first to deliver a simple yet effective solution:

  1. Input files must be in vector PDF format, which are then converted to vector SVG snapshots, leaving it to developers to choose the tools and workflows for generating the PDFs.
  2. PDFs are converted to vector SVG using pdf2svg for comparison.
  3. We assume it is sufficient to run visual regression tests in a single CI/CD operating system environment. Snapshots should be generated in a similar OS environment to ensure consistency with the CI/CD system.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyvdiff-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

tinyvdiff-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file tinyvdiff-0.1.0.tar.gz.

File metadata

  • Download URL: tinyvdiff-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tinyvdiff-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e367b8895862d419774d572cdc955fc575b8b5eafdd7d7f3625bfb119d96085b
MD5 a09b4d6beb314b51aeb5424fec08c055
BLAKE2b-256 7c4504bf85c4a37bbb802fc72b53b596eb2c2c552c858ee50a35b28e210f6325

See more details on using hashes here.

File details

Details for the file tinyvdiff-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tinyvdiff-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tinyvdiff-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07d9f56e50bd9db047c0206d24cfdc89950d34d9b158368389f226c979101ce6
MD5 ebe7475901f69fcef16adfa560bde479
BLAKE2b-256 33beeee7c24b12fc9fa29e4d9720da9ebfd324e09f03c4069eda735cf7a5044a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page