<div class="gmail_quote">On Thu, Sep 23, 2010 at 7:24 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Can this work? Split the current test suite for a concrete class that implements one of the ABCs into concrete-specific and ABC-general portions, with the abstract part parameterized by concrete class.</div>

<br>
For instance, split test/test_dict.py into test_dict.py and test_Mapping.py, where the latter has all tests that test compliance with the Mapping ABC (or whatever it is called) and the former keeps all the dict-specific extension tests. Rewrite test_Mapping so it is not dict specific, so one could write something like<br>
</blockquote><div><br></div><div>As a heavy user of the ABCs in the collections module, that would be awesome. :-)  It would make my life a lot easier when I'm writing tests to go along with an ABC-derived class.  I have 8 such classes on PyPi (heapdict.heapdict and blist.*), plus more in private repositories.</div>
<div><br></div><div>There is some code vaguely along those lines in the existing unit tests.  For example, Lib/test/seq_tests.py contains tests common to sequences.  However, that was written before collections.Sequence came along and the pre-2.6 definition of "sequence" only loosely correlates with a collections.Sequence.</div>
<div><br></div></div>-- <br>Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com/" target="_blank">Stutzbach Enterprises, LLC</a><br>