-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matchers not working according to docs #308
Comments
Thanks for the report, and that doesn't seem right to me at all. Are you able to provide a repro we can use to look at this? P.S. You probably actually want |
Sure, here it is: In it I reproduced the bug by using the Like matcher. |
Ah, thanks! I see the problem. In other languages, the event would have the matchers stripped. This can be done via the with pact_no_publish:
handler(event=event, context={}) I don't know Python very well, but ideally the It should be fairly straightforward in the meantime to create a utility function that recurses the with pact_no_publish:
reified_event = reify(event)
handler(event=reified_event, context={}) This is a bug, IMO, or at the very least, we should provide instructions as to how to use this better. |
Had a go at it and the code was actually pretty straight forward. The context manager does nothing for it and the unit tests are a knit a bit too tightly for implementing it in the context manager, since this would require a lot of change. It just handles cleaning up the test, there is nothing that gets setup when entering the conetxt. Would love to get some feedback and to get this merged/improved. 😄 |
@MdotMertens, you can make it work by calling |
Hello,
I want to use the matchers in my consumer tests but using them is kinda weird.
The way that I would expect them to work according to docs is:
What this does is to pass the Term object into the message.
What I have to do in this case is this:
This works but is the same as passing in a string directly and defeats the purpose of the matcher.
The text was updated successfully, but these errors were encountered: