Textualize / pytest-textual-snapshot

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

Allow limiting the snapshot compare limited to certain areas #13

Open pm-hwks opened 2 hours ago

pm-hwks commented 2 hours 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 2 hours 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.