Commits

Ronny Pfannschmidt  committed 8eb13a6

update

  • Participants
  • Parent commits 1bad54c

Comments (0)

Files changed (1)

File parametrize-items

 # HG changeset patch
-# Parent 8823c1dbe121daea50dccf6b41e46e75d0dce8b0
+# Parent 3da8cec6c5326ed27c144c9b6d7a64a648370005
+introduce items kwarg for parametrize  which provides (ids, argvalues) = zip(items)
 
 diff --git a/_pytest/python.py b/_pytest/python.py
 --- a/_pytest/python.py
 +++ b/_pytest/python.py
-@@ -605,7 +605,7 @@ class Metafunc:
+@@ -589,7 +589,7 @@ class Metafunc:
          self._calls = []
          self._ids = py.builtin.set()
  
          """ Add new invocations to the underlying test function using the list
          of argvalues for the given argnames.  Parametrization is performed
          during the collection phase.  If you need to setup expensive resources
-@@ -625,7 +625,15 @@ class Metafunc:
+@@ -609,7 +609,15 @@ class Metafunc:
          :arg ids: list of string ids each corresponding to the argvalues so
              that they are part of the test id. If no ids are provided they will
              be generated automatically from the argvalues.
 diff --git a/testing/test_python.py b/testing/test_python.py
 --- a/testing/test_python.py
 +++ b/testing/test_python.py
-@@ -1066,6 +1066,15 @@ class TestMetafunc:
-             "*6 fail*",
-         ])
+@@ -1048,6 +1048,15 @@ class TestMetafunc:
+         assert metafunc._calls[1].funcargs == dict(x=3, y=4)
+         assert metafunc._calls[1].id == "3-4"
  
 +    def test_parametrize_items(self):
 +        metafunc = funcargs.Metafunc(lambda x,y: None)