From b879074a646f00694235f2d1842991a3494f4c6b Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 16 Aug 2013 11:41:31 +0200 Subject: [PATCH] refs issue290 -- move and refactor the test the string/int-id parametrization test (Which xfails) --- testing/python/metafunc.py | 17 ++++++++++++++++ testing/test_parametrize_with_fixture.py | 25 ------------------------ 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index ace6599a4..464423e39 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -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) diff --git a/testing/test_parametrize_with_fixture.py b/testing/test_parametrize_with_fixture.py index f4e899b1c..5871ed8ee 100644 --- a/testing/test_parametrize_with_fixture.py +++ b/testing/test_parametrize_with_fixture.py @@ -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