Skip to content

Information about testing #551

May 10, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

app_snapshot is a pytest fixture that is defined by the pytest-textual-snapshot test dependency in Harlequin. I use my fork of Textualize's package. You need to install that package as a dependency before using the fixture; I don't recommend installing from my repo without forking it first, since I might change that at any time for Harlequin's purposes and break your stuff.

Basically, it uses Textual's built-in screenshotting capabilities and stores the SVG screenshot as a data snapshot with Syrupy. If the SVG changes between test runs, the test fails.

Textualize's package uses a fixture called snap_compare, which takes the path to an App file and a sequence of keystrokes. My fork adds the

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mirpedrol
Comment options

Answer selected by tconbeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #550 on May 10, 2024 14:55.