How to test a class' inherited methods in pytest

后端 未结 2 1304
春和景丽
春和景丽 2021-01-17 23:58

house.py:

class House:
    def is_habitable(self):
        return True

    def is_on_the_ground(self):
        return True

2条回答
  •  礼貌的吻别
    2021-01-18 00:32

    You can use pytest parameterization to pass multiple arguments to the same test, in this case, the argument would most likely be the class being tested.

提交回复
热议问题