drslump / pyshould

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

should.dump #30

Closed drslump closed 10 years ago

drslump commented 10 years ago

easy way to debug issues when using mocking libraries

call.verify('foo', {
  'param1': should.dump,
  'param2': should.dump('Value for param2'),
  'param3': should.dump('dumps and asserts').and_equal('foo')
})

When the assertions runs and the mocking library compares the values against should.dump the compared value is printed to the console. It allows to easily notice what are we receiving.

drslump commented 10 years ago

instead (or besides) of a matcher implement it as a general utility

{
  'foo': dumper(should.eq('Foo')),
  'bar': dumper('Bar', msg='This is bar')
}
drslump commented 10 years ago

Finally implemented as a general helper on 4a0b09c