From f78d87ee3836dd0e6eae408c536f83a2b8ba6a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= Date: Sat, 25 Jul 2015 15:38:11 +0200 Subject: [PATCH] Issue #751 - test. --- testing/python/collect.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/testing/python/collect.py b/testing/python/collect.py index dc073b103..5bbff6a64 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -472,6 +472,24 @@ class TestFunction: config.pluginmanager.register(MyPlugin2()) config.hook.pytest_pyfunc_call(pyfuncitem=item) + def test_issue751_multiple_parametrize_with_ids(self, testdir): + modcol = testdir.getmodulecol(""" + import pytest + @pytest.mark.parametrize('x', [0], ids=['c']) + @pytest.mark.parametrize('y', [0, 1], ids=['a', 'b']) + class Test(object): + def test1(self, x, y): + pass + def test2(self, x, y): + pass + """) + colitems = modcol.collect()[0].collect()[0].collect() + assert colitems[0].name == 'test1[a-c]' + assert colitems[1].name == 'test1[b-c]' + assert colitems[2].name == 'test2[a-c]' + assert colitems[3].name == 'test2[b-c]' + + class TestSorting: def test_check_equality(self, testdir): modcol = testdir.getmodulecol("""