From 6c54ee03de3bf0e4f43da0112dad6862cdcc1604 Mon Sep 17 00:00:00 2001 From: Marco Buccini Date: Thu, 15 Aug 2013 12:52:34 +0200 Subject: [PATCH] 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