New issue 422: Document ExceptionInfo.value
https://bitbucket.org/hpk42/pytest/issue/422/document-exceptioninfovalue

Jurko Gospodnetić:

I have not been able to find any documentation on how the actual exception 
raised during a pytest.raises() call can be accessed. A little research points 
to the ExceptionInfo.value attribute.

The docs should be updated to describe the ExceptionInfo.value attribute.

They should also be updated to include a note, similar to one already present 
in regular Python documentation, about having to explicitly delete all local 
references to the received ExceptionInfo instance. Those references are part of 
a reference cycle (exception --> stack frame raising the exception --> current 
stack frame --> locals --> exception_info --> exception) which, unless 
explicitly broken, will cause all objects in that cycle not to be garbage 
collected until potentially a much later time. YMMV, but this increases the 
test code memory footprint and possibly slows down the tests in case they can 
not finish until some finalizer code has run.

Hope this helps.

Best regards,
  Jurko Gospodnetić


_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to