"""A scenario featuring parametrized tests.
"""

import pytest


def test_multiple(ctestdir):
    ctestdir.makepyfile("""
        import pytest

        @pytest.mark.parametrize("x,y", [
            pytest.mark.dependency(name="a1")((0,0)),
            pytest.mark.dependency(name="a2")((0,1)),
            pytest.mark.dependency(name="a3")((1,0)),
            pytest.mark.dependency(name="a4")((1,1))
        ])
        def test_a(x,y):
            assert x==0 or y==0

        @pytest.mark.parametrize("u,v", [
            pytest.mark.dependency(name="b1", depends=["a1", "a2"])((1,2)),
            pytest.mark.dependency(name="b2", depends=["a1", "a3"])((1,3)),
            pytest.mark.dependency(name="b3", depends=["a1", "a4"])((1,4)),
            pytest.mark.dependency(name="b4", depends=["a2", "a3"])((2,3)),
            pytest.mark.dependency(name="b5", depends=["a2", "a4"])((2,4)),
            pytest.mark.dependency(name="b6", depends=["a3", "a4"])((3,4))
        ])
        def test_b(u,v):
            pass

        @pytest.mark.parametrize("w", [
            pytest.mark.dependency(name="c1", depends=["b1", "b3", "b5"])(1),
            pytest.mark.dependency(name="c2", depends=["b1", "b3", "b6"])(2),
            pytest.mark.dependency(name="c3", depends=["b1", "b2", "b4"])(3)
        ])
        def test_c(w):
            pass
    """)
    result = ctestdir.runpytest("--verbose")
    result.assert_outcomes(passed=7, skipped=5, failed=1)
    result.stdout.fnmatch_lines("""
        *::test_a?0-0? PASSED
        *::test_a?0-1? PASSED
        *::test_a?1-0? PASSED
        *::test_a?1-1? FAILED
        *::test_b?1-2? PASSED
        *::test_b?1-3? PASSED
        *::test_b?1-4? SKIPPED
        *::test_b?2-3? PASSED
        *::test_b?2-4? SKIPPED
        *::test_b?3-4? SKIPPED
        *::test_c?1? SKIPPED
        *::test_c?2? SKIPPED
        *::test_c?3? PASSED
    """)

@@ -138,16 +138,54 @@
 pytest%0A%0A
+        _md = pytest.mark.dependency%0A%0A
         
@@ -233,39 +233,45 @@
      pytest.
-mark.dependency
+param(0, 0, marks=_md
 (name=%22a1%22)(
@@ -273,14 +273,8 @@
 a1%22)
-((0,0)
 ),%0A 
@@ -287,39 +287,45 @@
      pytest.
-mark.dependency
+param(0, 1, marks=_md
 (name=%22a2%22)(
@@ -327,14 +327,8 @@
 a2%22)
-((0,1)
 ),%0A 
@@ -341,39 +341,45 @@
      pytest.
-mark.dependency
+param(1, 0, marks=_md
 (name=%22a3%22)(
@@ -381,14 +381,8 @@
 a3%22)
-((1,0)
 ),%0A 
@@ -395,39 +395,45 @@
      pytest.
-mark.dependency
+param(1, 1, marks=_md
 (name=%22a4%22)(
@@ -435,14 +435,8 @@
 a4%22)
-((1,1)
 )%0A  
@@ -559,39 +559,45 @@
      pytest.
-mark.dependency
+param(1, 2, marks=_md
 (name=%22b1%22, 
@@ -621,14 +621,8 @@
 2%22%5D)
-((1,2)
 ),%0A 
@@ -635,39 +635,45 @@
      pytest.
-mark.dependency
+param(1, 3, marks=_md
 (name=%22b2%22, 
@@ -697,14 +697,8 @@
 3%22%5D)
-((1,3)
 ),%0A 
@@ -711,39 +711,45 @@
      pytest.
-mark.dependency
+param(1, 4, marks=_md
 (name=%22b3%22, 
@@ -773,14 +773,8 @@
 4%22%5D)
-((1,4)
 ),%0A 
@@ -787,39 +787,45 @@
      pytest.
-mark.dependency
+param(2, 3, marks=_md
 (name=%22b4%22, 
@@ -849,14 +849,8 @@
 3%22%5D)
-((2,3)
 ),%0A 
@@ -863,39 +863,45 @@
      pytest.
-mark.dependency
+param(2, 4, marks=_md
 (name=%22b5%22, 
@@ -925,14 +925,8 @@
 4%22%5D)
-((2,4)
 ),%0A 
@@ -939,39 +939,45 @@
      pytest.
-mark.dependency
+param(3, 4, marks=_md
 (name=%22b6%22, 
@@ -1001,14 +1001,8 @@
 4%22%5D)
-((3,4)
 )%0A  
@@ -1108,39 +1108,42 @@
      pytest.
-mark.dependency
+param(1, marks=_md
 (name=%22c1%22, 
@@ -1169,18 +1169,16 @@
 , %22b5%22%5D)
-(1
 ),%0A     
@@ -1187,39 +1187,42 @@
      pytest.
-mark.dependency
+param(2, marks=_md
 (name=%22c2%22, 
@@ -1248,18 +1248,16 @@
 , %22b6%22%5D)
-(2
 ),%0A     
@@ -1270,31 +1270,34 @@
  pytest.
-mark.dependency
+param(3, marks=_md
 (name=%22c
@@ -1327,18 +1327,16 @@
 , %22b4%22%5D)
-(3
 )%0A      

Use pytest.param() to apply markers to parametrized tests.