Using pytest fixtures with hypothesis?

43 views
Skip to first unread message

Mel Seto

unread,
May 17, 2022, 3:30:02 PM5/17/22
to Hypothesis users
Hello,

I want to use hypothesis @example and a pytest fixture for the same test method, i.e.
Screen Shot 2022-05-17 at 3.25.17 PM.png

where `use_live_db` is a fixture defined in another fixtures-only file. However, pytest gets confused:

test setup failed
  @example(test_judge="Koh&q=Arg2")
def test_search_judges(use_live_db, test_judge):
E       fixture 'test_judge' not found
>       use 'pytest --fixtures [testpath]' for help on them.

How do I circumvent this error?

Thank you,
Mel

Reply all
Reply to author
Forward
0 new messages