Skip to content

Instantly share code, notes, and snippets.

@psav
Created November 21, 2013 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psav/7579967 to your computer and use it in GitHub Desktop.
Save psav/7579967 to your computer and use it in GitHub Desktop.
@pytest.fixture(params=['a', 'b'])
def do_something(request):
print request.param
@pytest.usefixtures(do_something, params=['c'])
def do_something_with_something_else():
'''Like to pass a custom setof params to the fixture'''
@hpk42
Copy link

hpk42 commented Nov 21, 2013

as a kind of hack you could do something like this i guess:

@pytest.fixture(params=["a", "b"])
def do_something(request):
...

@pytest.fixture(params=["c"])
def do_otherthing(request):
return do_something(request)

@pytest.usefixtures("do_otherthing")
def test_some():
pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment