From 6c54ee03de3bf0e4f43da0112dad6862cdcc1604 Mon Sep 17 00:00:00 2001 From: Marco Buccini Date: Thu, 15 Aug 2013 12:52:34 +0200 Subject: [PATCH 1/2] Fix @parametrize when using an integer and strings as parameters in a test accepting a parameter and a fixture as arguments. --- testing/test_parametrize_with_fixture.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 testing/test_parametrize_with_fixture.py diff --git a/testing/test_parametrize_with_fixture.py b/testing/test_parametrize_with_fixture.py new file mode 100644 index 000000000..ce35ce410 --- /dev/null +++ b/testing/test_parametrize_with_fixture.py @@ -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 From f5a6a843144746eb0e6cfce0c7b609f6083ca582 Mon Sep 17 00:00:00 2001 From: Marco Buccini Date: Fri, 16 Aug 2013 09:55:25 +0200 Subject: [PATCH 2/2] test marked as --- testing/test_parametrize_with_fixture.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testing/test_parametrize_with_fixture.py b/testing/test_parametrize_with_fixture.py index ce35ce410..f4e899b1c 100644 --- a/testing/test_parametrize_with_fixture.py +++ b/testing/test_parametrize_with_fixture.py @@ -1,5 +1,7 @@ +import pytest +@pytest.mark.xfail() def test_parametrize(testdir): testdir.makepyfile(""" import pytest