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:
parent
863a206727
commit
6c54ee03de
|
@ -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
|
Loading…
Reference in New Issue