Function declaration line shows as not executed
The coverage report for my app shows a function's contents as executed but says the line declaring the function was not. Here is an example:
class Person(object): def init(self, name): self.name = name
def speak(self, msg): print(msg)
and here is an example usage during my coverage process:
... p = Person("Jeremy") p.speak("I like coverage.py.") }}}
While this is purely an example, the report would tell me that lines 3 and 6 executed but not lines 2 and 5. I just updated to the latest version and I get the same result. (I tried with 3.0.1 and 3.1.)
I'm also seeing global-level comments and imports not being shown as executed either. So if I have:
"""This is where the database code goes."""
import os, sys
I end up with my report telling me lines 4-6 were not executed.
I've used this for a few Django-based projects before and never ran into problems like this and while it could be bad Python structure and/or user error, I figured this would be the place to start.