Skip to content

Instantly share code, notes, and snippets.

@public
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save public/e671a53b70fbb6fb6129 to your computer and use it in GitHub Desktop.
Save public/e671a53b70fbb6fb6129 to your computer and use it in GitHub Desktop.
import pytest
def pytest_generate_tests(metafunc):
if "fixA" in metafunc.fixturenames:
metafunc.parametrize("fixA", [])
def test_fixA(fixA):
print fixA
@pytest.mark.parametrize(["fixB"], [])
def test_fixB(fixB):
print fixB
@pytest.mark.parametrize(["fixB"], [])
def test_fixA_fixB(fixA, fixB):
print fixA, fixB
@pytest.mark.parametrize(["fixB"], [(1,)])
def test_fixA_fixB_bad(fixA, fixB):
print fixA, fixB
@pytest.mark.parametrize(["fixP"], [(1,)])
@pytest.mark.parametrize(["fixQ"], [])
def test_fixA_fixB_bad2(fixP, fixQ):
print fixP, fixQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment