python-hospital / hospital

Tools to diagnose Python projects (supervision, monitoring).
Other
40 stars 8 forks source link

hospital-serve output explains exception traceback #72

Open benoitbryon opened 10 years ago

benoitbryon commented 10 years ago

Current example:

{
    "status": "fail",
    "details": [
        {
            "test": "test_false (foo.bar)",
            "status": "fail",
            "context": "(<type 'exceptions.AssertionError'>, AssertionError(\"Failed to fetch URL http://localhost:8000/.\\nException was: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 111] Connection refused)\",), <traceback object at 0x7f34ac5bde18>)"
        }
    ],
    "summary": {
        "skip": 0,
        "pass": 0,
        "expected_failure": 0,
        "error": 0,
        "fail": 1,
        "total": 1,
        "unexpected_success": 0
    }
}

Some of the values in "context" are not readable. As an example the <traceback object at 0x7f34ac5bde18> could be explained => it would make it easier to figure out what's wrong, especially when the assertion message is not explicit enough.

benoitbryon commented 10 years ago

Note: using an explicit assertion error message should be the best practice.