def pytest_sessionfinish(session, exitstatus):
    """Attach the exit status to the session config so we can read it later.

    We need this in order to tell whether the test run passed or not.
    """
    setattr(session.config, 'exitstatus', exitstatus)
