python-coverage-comment-action icon indicating copy to clipboard operation
python-coverage-comment-action copied to clipboard

Idea for enhancing e2e coverage testing

Open ferdnyc opened this issue 1 year ago • 1 comments

(Originally posted in #466. Moved here so I don't lose track of it once the source PR is merged.)

I was thinking of submitting a (separate) PR that adds an actual code modification to the e2e tests, so that we could get a look at the diff coverage reporting as well. That's the part, if anything, that I think might need adjusting with branch coverage enabled.

(I figured I'd drop the test-ed function to just contain

def f(a="", b="", c="", d=""):
      elements = []
      if a:
          elements.append(a)
      if b:
          elements.append(b)
      """__ADD_CODE_HERE__"""
      return "-".join(elements)

...And then have the e2e test function insert the if c: and if d: blocks. (Or maybe even if c: ... elif d: which might make for better branch coverage testing.)

ferdnyc avatar Sep 27 '24 20:09 ferdnyc

And as mentioned in #466, this seems like an excellent idea !

ewjoachim avatar Sep 29 '24 08:09 ewjoachim