drslump / pyshould

Should style asserts based on pyhamcrest
MIT License
38 stars 7 forks source link

Add contain_sparse_in_order matcher #35

Closed tomas-mm closed 10 years ago

tomas-mm commented 10 years ago

Simple matcher useful to validate ordered sequences that may contain unmeaning items.

drslump commented 10 years ago

thanks for the contribution!

I thought about a more generic sparse wrapper to allow stuff like:

items | should.equal(sparse(3, 4)) 

But I didn't find a good way to make it work without changing the current architecture, so I think your solution is probably the best option. Although the implementation is a bit obscure :)

jsmolina commented 10 years ago

Absolutely nice feature

tomas-mm commented 10 years ago

thx guys!, changes done!

drslump commented 10 years ago

thanks @tomas-mm

drslump commented 10 years ago

@tomas-mm @jsmolina https://pypi.python.org/pypi/pyshould/0.6.2