[Python-Dev] Proposed unittest changes

Raymond Hettinger python at rcn.com
Tue Jul 15 01:26:45 CEST 2008


From: "Ben Finney" <ben+python at benfinney.id.au>
> Right, so I'm putting up a separate PEP just for the renaming. Should
> be arriving on this list soon.

I would like to work with you or someone else who is interested
on an alternative PEP for a separate, simpler test module
using the py.test syntax.  That is much simpler to learn and use.
Instead of self.assertIsNot and whatnot, you write:
   assert a is not b
No need for tons of word-by-word spellings on things we already
have syntax for.  Almost anyone who has used py.test can attest
its syntax is much more natural, easy to learn, easy to both
read and write, and is much lighter weight.  I think some variant
of py.test could be done that is compatable with unittest
and the did not have the "magic" present in earlier versions of py.test.
I wrote a recipe (somewhat rough and incomplete) that shows how
easily this could be done:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/572194

Raymond


More information about the Python-Dev mailing list