0

Why coveralls does report the function or methods as not covered when body is covered?

Take a look at https://coveralls.io/files/431523503#L433 -- the entire body is covered but the method is not marked as covered.

I checked coverage on another project, JavaScript and it seems that it works for these so I suspect this is a bug, of Coverage or the configuration.

Update: I am starting to believe this is not a problem of Coveralls but a problem of pytest-cov because even the generated coverage.xml seems to mark member definitions and comments as not covered in PyCharm (see line 226, no reason to consider it not covered when the full body is covered).

enter image description here

sorin
  • 161,544
  • 178
  • 535
  • 806
  • 1
    What happens when you run `coverage` locally? Do the reports show the same thing as on Coveralls? I do not have the same issue with [my own project](https://coveralls.io/files/399613033). – jonrsharpe Jan 19 '15 at 12:28

2 Answers2

0

coveralls only highlights lines it has been told to

When a source file is uploaded it is up to the client to mark each line as covered or not and coveralls just renders what it has been supplied (see the API documentation)

If your tool does not mark the line properly then coveralls will not render it

Shaun Wilde
  • 8,228
  • 4
  • 36
  • 56
0

I manage to fix the problem, it was due to the way I was calling coverage, I was importing something from the module before starting coverity.

Coverage was added at runtime when you did python setup.py test, if the module was present.

Take a look at https://github.com/pycontribs/jira/blob/master/setup.py - and you will find the trick that I had to implement for loading the version from the module without importing the module.

Importing a module before starting coverage will get you into cases where coverage is incomplete or not run at all.

sorin
  • 161,544
  • 178
  • 535
  • 806