Fix @parametrize when using an integer and strings as parameters in a test accepting a parameter and a fixture as arguments.

This commit is contained in:
Marco Buccini 2013-08-15 12:52:34 +02:00
parent 863a206727
commit 6c54ee03de
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
def test_parametrize(testdir):
testdir.makepyfile("""
import pytest
@pytest.fixture
def myfixture():
return 'example'
@pytest.mark.parametrize(
'limit',
(
0,
'0',
'foo',
)
)
def test_limit(limit, myfixture):
return
""")
reprec = testdir.runpytest()
assert 'KeyError' in reprec.stdout