<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><div>Hi folks.</div><div><br></div><div>I&#39;m still working on converting that large codebase from unittest to pytest (in parallel with a couple of other projects).</div><div><br></div><div>I was able to get past the runTest issue I was seeing, with the great help on this list.  It turned out to be because we were using unittest.TestCase and:</div><div><div>      runner = unittest.TextTestRunner(verbosity=3)                                                                         </div><div>      result = runner.run(test_suite)                                                                                                  </div></div><div><br></div><div>Now I have a new question: Does pytest allow one test class to inherit from another?</div><div><br></div><div>I&#39;m asking, because our unittest test cases use inheritance a lot.  With our somewhat strange use of runTest, this was working well enough, but with pytest it appears to be a problem.</div><div><br></div><div>Specifically, we have lots of things like:</div><div><div>      def setup_method(self):                                                                                                          </div><div>          super(TestFeatures, self).setup_method()                                                                                     </div></div><div>And we -had- a lot of:</div><div>      def __init__(self):</div><div>          super(TestFeatures, self).__init__()</div><div>...but I eliminated those by merging them into setup_method().  I did this because pytest apparently skips any test class that has an __init__ method.</div><div><br></div><div>However, now from our many setup_method&#39;s I&#39;m getting things like:</div><div><div>&gt;       super(FeatureElasticSearchAwareTestCase, self).setup_method()</div><div>E       AttributeError: &#39;super&#39; object has no attribute &#39;setup_method&#39;</div></div><div><br></div><div>And I chased up the inheritance hierarchy, and found that every super class but object itself has a .setup_method().  This is a 2.x and 3.x codebase, so that&#39;s why it cares about object.</div><div><br></div><div>So I ask: does pytest eliminate the possilbity of using an inheritance hierarchy in the test code? Or is this another oddity of the codebase I&#39;m working on?</div><div><br></div><div>Thanks!</div><div><br></div></div></div></div></div>