mercredi 16 décembre 2020

Python: code coverage using only function names

I am aware of the coverage module but I don't think it does what I need.

I have a bunch of functions like so:

def foo():
  # code

def bar():
  # code

def baz():
  # code

and a bunch of test functions, like so:

def test_foo():
  # code

def test_bar():
  # code

Is there a python package that will tell me, just by comparing the names of test functions with those of actual functions, that 2/3 are tested (foo, bar), but 1/3 is not (baz)?

I specifically don't want to go through every line inside the function, just to see if there's a test with a matching name.

Aucun commentaire:

Enregistrer un commentaire