Код: Выделить всё
import pytest
def throw_with_cause():
raise Exception("Failed") from ValueError("That was unexpected.")
with pytest.raises(Exception): # from ValueError???
throw_with_cause()
Есть ли простой способ сделать это с помощью поднятий ptyest?
Подробнее здесь: https://stackoverflow.com/questions/704 ... est-raises
Мобильная версия