|
return getattr(item._obj, '__allure_display_name__', None) |
This code has come up in a pytest-mypy issue because ._obj (which seems to be available publicly as .obj, btw) is not defined on MypyItems (custom pytest.Items used for running mypy on collected modules). Moreover, I don't know of a way to reasonably define it since MypyItems are not associated with any particular test function. That suggests that perhaps allure-pytest should be made to ignore such Items or, in this case, at least gracefully degrade into returning None when allure_title is called on them:
try:
return item.obj.__allure_display_name__
except AttributeError:
return None
allure-python/allure-pytest/src/utils.py
Line 34 in 524beb8
This code has come up in a
pytest-mypyissue because._obj(which seems to be available publicly as.obj, btw) is not defined onMypyItems (custompytest.Items used for runningmypyon collected modules). Moreover, I don't know of a way to reasonably define it sinceMypyItems are not associated with any particular test function. That suggests that perhapsallure-pytestshould be made to ignore suchItems or, in this case, at least gracefully degrade into returningNonewhenallure_titleis called on them: