drslump / pyshould

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

is there a way to include a msg inside should ? #27

Closed lowks closed 10 years ago

lowks commented 10 years ago

for example

[1,2,3].should_all.be(greater_than(0), msg="to ensure that all of them are bigger than 0")

?

drslump commented 10 years ago

sorry for the delay, I missed this issue.

You can use the desc method:

[1,2,3].should_all.be_greater_than(0).desc('to ensure that all of them are bigger than 0')