Textualize / pytest-textual-snapshot

Snapshot testing for Textual applications
MIT License
23 stars 4 forks source link

Allow limiting the snapshot compare limited to certain areas #13

Open pm-hwks opened 1 month ago

pm-hwks commented 1 month ago

Appreciate all the great work and attention to detail this team has put into textual. Its simply amazing.

As part of the mock testing, there are certain areas that remains the same however there are other areas that can change (timestamps etc).

image

how can i achieve this outcome ?

willmcgugan commented 1 month ago

There is no way to do that.

Snapshot tests should be used to confirm data will display as you expect. In order to do that, you need consistent data.

If your data isn't consistent, it suggests snapshots may be the wrong kind of tests. You should probably use more conventional unit tests for that.