mirror of
https://github.com/1j01/textual-paint.git
synced 2024-11-24 08:44:45 +03:00
WIP: set up snapshot testing
This commit is contained in:
parent
f81e5d8250
commit
ed97f0afb0
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,8 @@
|
||||
|
||||
# pytest-textual-snapshot
|
||||
snapshot_report.html
|
||||
|
||||
|
||||
# Temporary backup files from Textual Paint and other editors
|
||||
*~
|
||||
|
||||
|
@ -123,6 +123,7 @@
|
||||
"pyperclip",
|
||||
"pypixelart",
|
||||
"pyright",
|
||||
"pytest",
|
||||
"pyxdg",
|
||||
"qualname",
|
||||
"rasterization",
|
||||
|
@ -12,3 +12,5 @@ textual[dev]==0.28.0
|
||||
watchdog==3.0.0 # for development; optional (only used when --restart-on-changes is passed)
|
||||
types-Pillow==10.0.0.1 # for development
|
||||
types-psutil==5.9.5.15 # for development
|
||||
pytest==7.4.1 # for development
|
||||
pytest-textual-snapshot==0.4.0 # for development
|
||||
|
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
18
tests/test_snapshots.py
Normal file
18
tests/test_snapshots.py
Normal file
@ -0,0 +1,18 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
# These paths are treated as relative to this file.
|
||||
APPS_DIR = Path("../src/textual_paint")
|
||||
PAINT = APPS_DIR / "paint.py"
|
||||
GALLERY = APPS_DIR / "gallery.py"
|
||||
|
||||
def test_paint_app(snap_compare):
|
||||
assert snap_compare(PAINT)
|
||||
|
||||
def test_paint_stretch_skew(snap_compare):
|
||||
assert snap_compare(PAINT, press=["ctrl+w"])
|
||||
|
||||
def test_gallery_app(snap_compare):
|
||||
assert snap_compare(GALLERY)
|
||||
|
Loading…
Reference in New Issue
Block a user