refs issue290 -- move and refactor the test the string/int-id parametrization test (Which xfails)
This commit is contained in:
parent
4800aeaef7
commit
b879074a64
|
@ -813,3 +813,20 @@ class TestMarkersWithParametrization:
|
||||||
testdir.makepyfile(s)
|
testdir.makepyfile(s)
|
||||||
reprec = testdir.inline_run()
|
reprec = testdir.inline_run()
|
||||||
reprec.assertoutcome(passed=2, skipped=2)
|
reprec.assertoutcome(passed=2, skipped=2)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="issue 290")
|
||||||
|
def test_parametrize_ID_generation_string_int_works(self, testdir):
|
||||||
|
testdir.makepyfile("""
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def myfixture():
|
||||||
|
return 'example'
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
'limit', (0, '0'))
|
||||||
|
def test_limit(limit, myfixture):
|
||||||
|
return
|
||||||
|
""")
|
||||||
|
reprec = testdir.inline_run()
|
||||||
|
reprec.assertoutcome(passed=2)
|
||||||
|
|
|
@ -1,26 +1 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail()
|
|
||||||
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