Georg Brandl, 13.04.2011 08:54:
On 13.04.2011 02:07, Antoine Pitrou wrote:
On Tue, 12 Apr 2011 19:50:34 -0400
Tres Seaver wrote:
Trying to accelerate existing code which doesn't have the coverage is
insane: how can you know that the accelerator doesn't subtly change the
semantics without tests?
Well, why do you think tests guarantee that the semantics are the same?
Tests are not a magic bullet. "Covering" a code path doesn't ensure
that every possible behaviour is accounted for.
def foo(a, b):
if condition(a):
bar = b
do_something_with(bar)
This has 100% coverage if "condition" is usually true :)
I understand that you are joking. However, the PEP mentions *branch*
coverage as the 100% goal, which would imply that the above issue gets caught.
Stefan
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com