Files
pytest2/example/funcarg/parametrize/test_parametrize3.py
holger krekel 6bde251d68 adding exampels as per blog post
--HG--
branch : trunk
2009-05-13 17:42:22 +02:00

16 lines
463 B
Python

# following hook can be put unchanged into a local or global plugin
def pytest_generate_tests(metafunc):
for scenario in metafunc.cls.scenarios:
metafunc.addcall(id=scenario[0], funcargs=scenario[1])
scenario1 = ('basic', {'attribute': 'value'})
scenario2 = ('advanced', {'attribute': 'value2'})
class TestSampleWithScenarios:
scenarios = [scenario1, scenario2]
def test_demo(self, attribute):
assert isinstance(attribute, str)