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

Union/composite matchers? #8

Open
skshetry opened this issue Aug 15, 2022 · 0 comments
Open

Union/composite matchers? #8

skshetry opened this issue Aug 15, 2022 · 0 comments

Comments

@skshetry
Copy link
Member

skshetry commented Aug 15, 2022

Example use case:

  1. I want to check if the exception is of some instance and check that they have correct attrs. We can just do duck typing, but sometimes, we want to have a stricter check.

The following is a snippet that I was playing with in my mind:

>>> M.instance_of(YAMLCorruptedError) & M(path="params.yaml")

I also see that this API is going to complicate implementation, so we can brainstorm other ideas too to have composite matchers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant