Le 10/11/2013 15:48, Nick Coghlan a écrit :
It would make more sense to just bake py.test style rich assertions into the language in some way and let people write:
def sum(iterable): # implementation of sum assert sum() == 0 assert sum([1, 2, 3]) == 6
This has the same problem as doctests: it works well for trivial tests like the above, but will be difficult to scale towards more complicated testing.
unittest-like structuration is really what works best for most testing situations, IMO. Alternative testing schemes for "easier" or "more intuitive" testing have generally failed as general-purpose tools.