<div dir="ltr">Hi,<div><br></div><div>My testcode looks something like below:</div><div><pre style="color:rgb(0,0,0);font-family:&quot;courier new&quot;;font-size:9pt">@<span style="color:rgb(0,0,178)">pytest.fixture</span>(<span style="color:rgb(102,0,153)">scope</span>=<span style="color:rgb(0,128,128);font-weight:bold">&#39;module&#39;</span>)<br><span style="color:rgb(0,0,128);font-weight:bold">def </span>modFixture_1(<span style="color:rgb(128,128,128)">request</span>):<br>    ...<br><br>@<span style="color:rgb(0,0,178)">pytest.fixture</span>(<span style="color:rgb(102,0,153)">scope</span>=<span style="color:rgb(0,128,128);font-weight:bold">&#39;module&#39;</span>)<br><span style="color:rgb(0,0,128);font-weight:bold">def </span>modFixture_2(<span style="color:rgb(128,128,128)">request</span>,<br>                 <span style="color:rgb(128,128,128)">modFixture_1</span>):<br>    ...<br><br><br><span style="color:rgb(0,0,128);font-weight:bold">def </span>test_001(<span style="color:rgb(128,128,128)">testCase</span>,<br>             <span style="color:rgb(128,128,128)">modFixture_2</span>):<br>    ...<br>    ...<br>    ...<br></pre><div><div><br></div><div>I am able to parametrize fixture &quot;<span style="color:rgb(128,128,128);font-family:&quot;courier new&quot;;font-size:9pt">modFixture_2&quot; </span>using the below statement:</div><div><span style="color:rgb(128,128,128);font-family:&quot;courier new&quot;;font-size:9pt"><br></span></div><div><pre style="color:rgb(0,0,0);font-family:&quot;courier new&quot;;font-size:9pt"><pre style="font-family:&quot;courier new&quot;;font-size:9pt">@<span style="color:rgb(0,0,178)">pytest.mark.parametrize</span>(<span style="color:rgb(0,128,128);font-weight:bold">&#39;modFixture_2&#39;</span>, [<span style="color:rgb(0,128,128);font-weight:bold">&quot;someValue&quot;</span>], <span style="color:rgb(102,0,153)">indirect</span>=[<span style="color:rgb(0,128,128);font-weight:bold">&#39;modFixture_2&#39;</span>])</pre><pre style="font-family:&quot;courier new&quot;;font-size:9pt"><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;white-space:normal">But i want to parameterize &quot;<span style="font-family:&quot;courier new&quot;;font-size:9pt;color:rgb(0,0,0)">modFixture_1&quot; </span><span style="font-size:12.8px">fixture. How to go about this? (i dont want to include that explicitly inside my testcase as i dont want anyone to use the return value of that fixture inside my testcase...)</span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;white-space:normal"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;white-space:normal">I dont want to go with a static way of parameterization : <span style="background-color:rgb(245,245,245);color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt">@pytest.fixture</span><span class="gmail-p" style="color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt">(</span><span class="gmail-n" style="color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt">params</span><span class="gmail-o" style="color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt;font-weight:700">=</span><span class="gmail-p" style="color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt">[</span><span class="gmail-s1" style="font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt;color:rgb(187,136,68)">&#39;a&#39;</span><span class="gmail-p" style="color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt">,</span><span style="background-color:rgb(245,245,245);color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt"> </span><span class="gmail-s1" style="font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt;color:rgb(187,136,68)">&#39;b&#39;</span><span class="gmail-p" style="color:rgb(51,51,51);font-family:consolas,menlo,&quot;liberation mono&quot;,courier,monospace;font-size:9pt">])</span></div></pre><pre style="font-family:&quot;courier new&quot;;font-size:9pt"><br></pre></pre></div><div class="gmail_signature"><span style="font-size:12.8px">because some of my testcases may parameterize the fixture and some may not and the values may also differ for each testcase.. </span></div><div class="gmail_signature"><span style="font-size:12.8px"><br></span></div><div class="gmail_signature"><span style="font-size:12.8px">Also is it possible to pass the result of one fixture to another during the parameterization phase.?</span></div><div class="gmail_signature"><span style="font-size:12.8px"><br></span></div><div class="gmail_signature"><span style="font-size:12.8px">like say the request fixture itself as below:</span></div><div class="gmail_signature"><span style="font-size:12.8px"><br></span></div><div class="gmail_signature"><pre style="color:rgb(0,0,0);font-family:&quot;courier new&quot;;font-size:9pt"><pre style="font-family:&quot;courier new&quot;;font-size:9pt">@<span style="color:rgb(0,0,178)">pytest.mark.parametrize</span>(<span style="color:rgb(0,128,128);font-weight:bold">&#39;modFixture_1&#39;</span>, [genValues(request)], <span style="color:rgb(102,0,153)">indirect</span>=[<span style="color:rgb(0,128,128);font-weight:bold">&#39;modFixture_1&#39;</span>])<br></pre><pre style="font-family:&quot;courier new&quot;;font-size:9pt"><br></pre></pre></div><div class="gmail_signature"><span style="font-size:12.8px"><br></span></div><div class="gmail_signature"><br></div><div class="gmail_signature"><span style="font-size:12.8px"></span>அன்புடன்,<br>
பா. அருண் காளி ராசா </div>
</div></div></div>