[Python-Dev] PEP: Consolidating names and classes in the `unittest` module (updated 2008-07-15)

Terry Reedy tjreedy at udel.edu
Tue Jul 15 19:09:05 CEST 2008



Stephen J. Turnbull wrote:

> Yes, for the purposes of this PEP.  We already know that many people
> want various different things.  You want fail* /rather than/ assert*,
> but Steven d'Aprono wants /both/, and I prefer assert* /exclusively/.
> I don't see why we all shouldn't be satisfied[1], so the content of
> unittest should not set policy for our own projects.  So there should
> be other modules (perhaps in the stdlib, perhaps not) to satisfy those
> preferences not catered to by stdlib's unittest.

It should be trivial to write a module 'unitfail' that would 'from 
unittest import *' and then flip the assert names to fail names.  The 
only question is whether it needs to be in the stdlib or merely PyPI.

I word this this way because Guido has already blessed the assert forms 
for unittest.  If he is persuaded otherwise, revise accordingly.

> Thus this PEP should restrict it's concern to revising unittest to
> conform to PEPs and help standardize Python's own testing, without
> trying to impose standards on the whole community of Python users.

For the community as a whole, all stdlib modules are suggestions and 
examples, not commands.

tjr



More information about the Python-Dev mailing list