Skip to content

How can i pass objects in metafunc.parametrize #13386

Answered by sar009
sar009 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks a lot, Ronny, this helped.

class MyClass:
    def __init__(self, my_param: str):
        self.my_param = my_param

    def __eq__(self, other):
        return isinstance(other, MyClass) and self.my_param == other.my_param

    def __hash__(self):
        return hash(self.my_param)

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@sar009
Comment options

@RonnyPfannschmidt
Comment options

@RonnyPfannschmidt
Comment options

@sar009
Comment options

Answer selected by sar009
@sar009
Comment options

@RonnyPfannschmidt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants