From 30d32314cf082d4353d82357670ed39561e35873 Mon Sep 17 00:00:00 2001 From: Sadra Barikbin Date: Fri, 15 Dec 2023 23:17:30 +0330 Subject: [PATCH] Add a tiny test --- testing/python/metafunc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index fa08e9b46..bf1157e8a 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -993,6 +993,14 @@ class TestMetafunc: assert metafunc._calls[2].indices == dict(x=0, y=2) assert metafunc._calls[3].indices == dict(x=2, y=0) + def test_parametrize_with_unhashable_duplicate_values(self) -> None: + metafunc = self.Metafunc(lambda x: None) + metafunc.parametrize(("x"), [[1], [2], [1]]) + assert len(metafunc._calls) == 3 + assert metafunc._calls[0].indices == dict(x=0) + assert metafunc._calls[1].indices == dict(x=1) + assert metafunc._calls[2].indices == dict(x=2) + def test_high_scoped_parametrize_reordering(self, pytester: Pytester) -> None: pytester.makepyfile( """