[Python-Dev] Using more specific methods in Python unit tests

Antoine Pitrou solipsis at pitrou.net
Sun Feb 16 11:39:30 CET 2014

On Sat, 15 Feb 2014 20:12:33 +0200
Serhiy Storchaka <storchaka at gmail.com> wrote:
> I wrote a large patch which modifies the tests to use more specific 
> methods [1]. Because it is too large, it was divided into many smaller 
> patches, and separate issues were opened for them. At the moment the 
> major part of the original patch has already been committed. Many thanks 
> to Ezio for making a review for the majority of the issues. Some changes 
> have been made by other people in unrelated issues.
> Although Raymond approved a patch for test_bigmem [2], his expressed the 
> insistent recommendation not to do this. So I stop committing new 
> reviewed patches. Terry recommended to discuss this in Python-Dev. What 
> are your thoughts?

When it comes specifically to test_bigmem, it is important for error
messages to be informative, because the failures may be hard (if not
enough RAM) or very long to diagnose on a developer's machine. So +1 to
changing test_bigmem.

As for the rest of the test suite, I find the "assertSpecific" form
more readable that "assertTrue(... with some operator)". But I may be
in a minority here :-)

As for the "code churn" argument, I find that a much less important
concern for the test suite than for the rest of the code.



More information about the Python-Dev mailing list