unittest vs py.test?

Raymond Hettinger vze4rx4y at verizon.net
Sat Apr 2 04:39:02 EST 2005


[Peter Hansen]
> This is pretty, but I *want* my tests to be contained
> in separate functions or methods.

In py.test, those would read:

def test1():
    assert a == b

def test2():
    raises(Error, func, args)

Enclosing classes are optional.


Raymond





More information about the Python-list mailing list