Java or Python 3.5 is not an option for my organization for now. and I want to make sure the our code has 100% coverage. But I run into the following issues.
in a.py (By developer01)
class API1(object):
def f(self):
"""return a list of int"""
raise NotImplementedError()
in b.py (By developer02)
class API1Impl1(a.API1):
def f(self):
return 3
in test_b.py(By developer02)
def test_api1_impl1():
api1impl = API1Impl1()
assert api1impl.f() == 1
In the above case, if we use py.test cov function, we still can see the 100% coverage. but that's not what I want.
As a developer01, can I did some magic so that any others test their API1ImplX class, the following code will be executed.
ret = api1impl.f()
assert isinstance(ret) and all([isinstance(i, int) for i in ret])
Aucun commentaire:
Enregistrer un commentaire