b0g3r / perseus

WIP: snapshot management tool
MIT License
1 stars 1 forks source link

Snapshot matching syntax #5

Closed Bobronium closed 3 years ago

Bobronium commented 3 years ago

Is it just me, or the first one reads more natural than the second one?

assert snapshot.match('value')
snapshot.assert_match('value)

Second one reminds me of unittests's assert methods 😢

Another option is assert snapshot == value, but it breaks common actual == expected pattern, so I'm not sure whether it should be used.

b0g3r commented 3 years ago

Thank you for the great idea! I totally agree with you, syntax with assert looks more natural. I actually didn't like pytest-mock because of mocked.assert_called_once() 😅