<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 25, 2016 at 5:57 PM Fred Drake &lt;<a href="mailto:fred@fdrake.net">fred@fdrake.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Feb 25, 2016 at 3:06 PM, Bruno Oliveira &lt;<a href="mailto:nicoddemus@gmail.com" target="_blank">nicoddemus@gmail.com</a>&gt; wrote:<br>
&gt; Just a small correction, py.test supports &quot;setUp&quot; and &quot;tearDown&quot;, but only<br>
&gt; for xUnit subclasses (otherwise they wouldn&#39;t work out of the box).<br>
<br>
This seems to be exactly where I&#39;ve run into a problem, though:  I am using a<br>
unittest.TestCase-derived test class, and setUp / tearDown aren&#39;t being used.<br></blockquote><div><br></div><div>I see, but that TestCase-derived test class was being created by a generator-style test, right? Unfortunately generator-style tests in py.test have some edge cases, and it has been said that there&#39;s no plans to improve on that area because generator-style tests have been supplanted by parametrized tests[1].</div><div><br></div><div>Sorry I didn&#39;t elaborate further, just wanted to clarify that setUp/tearDown are supported for &quot;normal&quot; xUnit subclasses. :)</div><div><br></div><div>[1] <a href="http://pytest.org/latest/parametrize.html">http://pytest.org/latest/parametrize.html</a></div><div><br></div><div>Cheers,</div><div>Bruno.</div></div></div>