Closed catriuspham closed 7 years ago
@NhanHo @hieueastagile please take a look :)
@catriuspham Your implementation is great, but my thought that we must have a better explanation system, so we are not just working around for this case but solve it generally and completely. We can do something like this
Expect X=123 to be equal Y='123', X is integer but Y is string.
and also for object comparision
Expect X={'key1': 'a'} to be equal Y={'key2': 'b'}. X has 'key1' but Y doesn't.
Wdyt?
@hieueastagile Your idea is cool, but I cannot figure out a good way to do it rather than handling each scenario separately. @NhanHo Do you have any suggestions?
@catriuspham You can take a look at sure
. It had kind of DeepExplaination
, which is the idea that I originated from. But yes, we need to handle it quite specifically.
I think for the case of type, we just need to make the message clearer like:
Expected "123" (type `int`) to equal "123" (type `str`).
So @catriuspham's approach is fine for me 😛.
@tklarryonline glad to see you alive!
@catriuspham Ok, so please ask @oyster to merge this to master first, I will make the clearer requirements for deep explanation later.
Issue: https://github.com/EastAgile/robber.py/issues/30
Change the eq failure message format to this:
For example:
Returns the message: