Skip to content

Commit

Permalink
add test_parametrize_ids_iterator_without_mark
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Nov 19, 2019
1 parent b96b7d6 commit ba1d4f0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions testing/python/metafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,26 @@ def func(x, y):
("x", "y"), [("abc", "def"), ("ghi", "jkl")], ids=["one"]
)

def test_parametrize_ids_iterator_without_mark(self):
import itertools

def func(x, y):
pass

it = itertools.count()

metafunc = self.Metafunc(func)
metafunc.parametrize("x", [1, 2], ids=it)
metafunc.parametrize("y", [3, 4], ids=it)
ids = [x.id for x in metafunc._calls]
assert ids == ["0-2", "0-3", "1-2", "1-3"]

metafunc = self.Metafunc(func)
metafunc.parametrize("x", [1, 2], ids=it)
metafunc.parametrize("y", [3, 4], ids=it)
ids = [x.id for x in metafunc._calls]
assert ids == ["4-6", "4-7", "5-6", "5-7"]

def test_parametrize_empty_list(self):
"""#510"""

Expand Down

0 comments on commit ba1d4f0

Please sign in to comment.