Skip to content
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

Disable PookNoMatch attempted matching output #79

Closed
henry-nextroll opened this issue Sep 20, 2021 · 3 comments
Closed

Disable PookNoMatch attempted matching output #79

henry-nextroll opened this issue Sep 20, 2021 · 3 comments
Labels
enhancement needs discussion Issues that require additional discussion before they can be resolved

Comments

@henry-nextroll
Copy link

Hello,

Whenever I run into the classic PookNoMatches error, it seems like pook will try to show the "closest" mock that exists that is similar to the request that was just made. 99.9% of the time, the "closest" mock is not even remotely similar to what I just made, and my terminal is basically filled up with more confusing than helpful text. My questions are:

  1. Why is this a feature?
  2. Does pook come with functionality to disable this or do I have to implement this myself?

Thanks,
Henry

@henry-nextroll
Copy link
Author

I found I can disable the attempted matching logs via:

pook.api.debug(False)

However I am still curious why this is a feature.

@sarayourfriend
Copy link
Collaborator

Hi Henry. I've personally found this feature useful precisely when a mock is slightly misconfigured. For example, I've run into issues with a particular path configuration not creating the matcher I expected, and it was helpful to have that logging. I've also found it useful when pook unexpectedly intercepts requests that I didn't intend for it to intercept (i.e., because it was on when I didn't expect it to be).

Do you have a suggestion for how to improve this feature? It would be a significant change to remove it entirely, but I could see an argument for reversing the default and only outputting the full debug text when pook.api.debug is explicitly turned on. However, in that case, would you suggest an alternative "minimal" logging output? I haven't run into the same issues with it as you, so I'm struggling to think of appropriate alternatives.

@sarayourfriend sarayourfriend added enhancement needs discussion Issues that require additional discussion before they can be resolved labels Oct 26, 2023
@sarayourfriend
Copy link
Collaborator

I'm closing this issue due to there not being any relevant changes to make for this. The workaround is available.

@sarayourfriend sarayourfriend closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs discussion Issues that require additional discussion before they can be resolved
Projects
None yet
Development

No branches or pull requests

2 participants