Status: Accepted
Owner: smichr
Labels: Type-Defect Priority-Medium

New issue 1613 by smichr: coverage stmt green even if not fully covered
http://code.google.com/p/sympy/issues/detail?id=1613

The coverage tool has been working really well as I try to increase code
coverage, but I have noticed that it could perhaps be improved for the
following situations which aren't totally covered:

=> if False: foo_action

The above line will show green because "if False" was evaluated; if the
line had been written as

if False:
   foo_action

then the if would be green but the foo_action would be red. So either
coverage could be modified to show inlines as red when evaluated as False
OR code_quality could test for inline statements and warn on such instances.

The same sort of thing happens on short-circuited expressions. Consider the
following where bad(1) is a non-existent function that would generate an
error if executed:

if False and bad(1):
   foo_action

Here, both lines will be green, but the "if" line has not been fully
covered if there is no test that that would have changed that False to
True. i.e. False is not the literal False in this context, it is an
expression which, during the coverage tests, evaluated to False, e.g.

if x != y or bad(1):
   foo

will show the "if" line as green if x != y but perhaps it would be possible
for x to equal y and in that case bad(1) will be called and an error  
generated.

/c

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to