Skip to content

Union/composite matchers? #8

@skshetry

Description

@skshetry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions