<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>Hello</div>
<div><br>
</div>
<div>I’ve extensive experience using&nbsp;Python unittest. However, I’ve some new code that I cannot test with unittest because the assertions must be applied in a derived class (call it class X) that contains methods executed by an application layer scheduler.
 Thus, tests of this code cannot be written as methods named test*() in a class derived from&nbsp;unittest.TestCase.</div>
<div><br>
</div>
<div>I attempted to address this problem by using pytest, because it is easy to write assert statements in&nbsp;class X. However, pytest doesn’t find the assert statements. Rather it reports “collected 0 items”.</div>
<div><br>
</div>
<div>Investigating further, I ran pytest —debug. In a cryptic, 700&#43; line log file it reports “message: cannot collect test class 'TestSimulationObject' because it has a __init__ constructor”. This doesn’t make sense. Python classes almost always use an&nbsp;__init__
 constructor. Nevertheless, I tried removing the&nbsp;class X’s __init__() constructor and initializing its attributes through another method. But pytest —debug still reports the same message in the debug log.</div>
<div><br>
</div>
<div>My primary interest is to automate the testing of class X. It would be nice if that could be done with Python unittest by making direct calls to the TestCase API but I suspect that would require more effort than I want to devote to solving this problem.
 Probably the best approach would be to use another testing framework that offers similar flexibility to pytest, but does indeed test Class X.</div>
<div><br>
</div>
<div>Please let me know what you think or recommend.&nbsp;</div>
<div>Thanks</div>
<div>Arthur</div>
<div><br>
</div>
<div>
<div style="color:rgb(0,0,0); letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div style="color:rgb(0,0,0); letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div style="color:rgb(0,0,0); letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div style="color:rgb(0,0,0); letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div style="color:rgb(0,0,0); letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div style="color:rgb(0,0,0); letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div style="color:rgb(0,0,0); letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div>
<div style="orphans:2; widows:2; border-collapse:separate; border-spacing:0px">
<div style="border-collapse:separate; border-spacing:0px">---</div>
<div>&nbsp;</div>
<div>Arthur Goldberg, PhD
<div style="border-collapse:separate; border-spacing:0px">Associate Professor of Genetics and Genomic Sciences</div>
<div style="border-collapse:separate; border-spacing:0px">Icahn Institute for Genomics &amp;&nbsp;Multiscale Biology</div>
<div>Icahn School of Medicine at Mount Sinai</div>
<div>
<div style="border-collapse:separate; border-spacing:0px">646 526 5020</div>
</div>
<div style="border-collapse:separate; border-spacing:0px"><a href="http://www.karrlab.org/" target="_blank">Karr Lab</a></div>
<div style="border-collapse:separate; border-spacing:0px"><a href="mailto:Arthur.Goldberg@mssm.edu" target="_blank">Arthur.Goldberg@mssm.edu</a></div>
</div>
</div>
<div style="orphans:2; widows:2">Follow us on Twitter&nbsp;<a href="https://twitter.com/IcahnInstitute" target="_blank">@IcahnInstitute</a></div>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
</div>
<br>
</div>
</body>
</html>