refs issue290 -- move and refactor the test the string/int-id parametrization test (Which xfails)

This commit is contained in:
holger krekel 2013-08-16 11:41:31 +02:00
parent 4800aeaef7
commit b879074a64
2 changed files with 17 additions and 25 deletions

View File

@ -813,3 +813,20 @@ class TestMarkersWithParametrization:
testdir.makepyfile(s)
reprec = testdir.inline_run()
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)

View File

@ -1,26 +1 @@
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