def test_unhandled_error(mocker):
mocker.patch('ldap2pg.script.dictConfig', autospec=True)
w = mocker.patch('ldap2pg.script.wrapped_main')
from ldap2pg.script import main
w.side_effect = Exception()
with pytest.raises(SystemExit) as ei:
main()
assert os.EX_SOFTWARE == ei.value.code
评论列表
文章目录