<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi Leah, Bob,</div>
<div> </div>
<div>at first glace i'd vaugely guess that the interaction with the _setupstate of the session prevents rerunning the setup.</div>
<div>My hypothesis is that the setupstate after the test protocol is the same as before a test call,</div>
<div>thus the next time setup is not executed due to already being set up.</div>
<div> </div>
<div>However i cant look into it in detail and verify my assumption till next week, since im currently traveling.</div>
<div> </div>
<div>i hope the hint will provide you with enough to debug the problem further</div>
<div> </div>
<div>-- Ronny</div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Samstag, 20. April 2013 um 05:55 Uhr<br/>
<b>Von:</b> "Leah Klearman" <lklrmn@gmail.com><br/>
<b>An:</b> "Bob Silverberg" <bob.silverberg@gmail.com>, pytest-dev <pytest-dev@python.org><br/>
<b>Betreff:</b> Re: [pytest-dev] [pytest-rerunfailures] pytest-rerunfailures not using fixtures on reruns (#10)</div>
<div name="quoted-content">
<div>Hi Holger and other py.test mavens,
<div> </div>
<div style="">Bob has reported a problem with my py.test plugin pytest-rerunfailures [1] not re-running the setup before rerunning the test.</div>
<div style=""> </div>
<div style="">Looking at my code, it has pytest_runtest_protocol() [2] looping on _pytest.runner.runtestprotocol() [3], which in turn runs the setup, the test, and the teardown.</div>
<div style=""> </div>
<div style="">[1] <a href="https://github.com/klrmn/pytest-rerunfailures" target="_blank">https://github.com/klrmn/pytest-rerunfailures</a></div>
<div style="">[2] <a href="https://github.com/klrmn/pytest-rerunfailures/blob/master/rerunfailures/plugin.py#L46" target="_blank">https://github.com/klrmn/pytest-rerunfailures/blob/master/rerunfailures/plugin.py#L46</a></div>
<div style="">[3] <a href="https://bitbucket.org/hpk42/pytest/src/fdc28ac2029f1c0be1dac4991c2f1b014c39a03f/_pytest/runner.py?at=default#cl-65" target="_blank">https://bitbucket.org/hpk42/pytest/src/fdc28ac2029f1c0be1dac4991c2f1b014c39a03f/_pytest/runner.py?at=default#cl-65</a></div>
<div style=""> </div>
<div style="">I haven't taken the hours needed to get my head fully into py.test plugin development mode, but I'm not sure I can implement a fix at my layer.</div>
<div style=""> </div>
<div style="">I'm hoping someone here will have some insight.</div>
<div style=""> </div>
<div style="">Thanks,</div>
<div style="">-Leah</div>
</div>
<div class="gmail_extra">
<div class="gmail_quote">On Sun, Apr 14, 2013 at 6:29 PM, Bob Silverberg <span><<a href="notifications@github.com" target="_parent">notifications@github.com</a>></span> wrote:
<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">
<p>I just verified this behaviour myself with a simple test [1]. I see it with both funcargs and fixtures, but I'm not sure if it has to do with the plugin, or the way py.test works. It does inject the value into the test method, but it doesn't rerun the fixture, so it seems like it is caching the first run of the fixture and using that on subsequent runs.</p>
<p>I'm not sure if this is something that the plugin can have any effect on, or if it's just the way fixtures work. It is specified for this fixture that it is <code>scope='function'</code>, and perhaps py.test makes that happen by checking the function name, which is, of course, the same for each run. I did try removing the scope argument from the fixture but that had no effect.</p>
<p>Do you have any thoughts about this, <a href="https://github.com/klrmn" target="_blank">@klrmn</a>?</p>
<p>[1] <a href="https://gist.github.com/bobsilverberg/5385035" target="_blank">https://gist.github.com/bobsilverberg/5385035</a></p>
<div class="HOEnZb">
<div class="h5">
<p style="font-size: small;color: rgb(102,102,102);">—<br/>
Reply to this email directly or <a href="https://github.com/klrmn/pytest-rerunfailures/issues/10#issuecomment-16363644" target="_blank">view it on GitHub</a>.<img height="1" width="1"/></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>