def pytest_terminal_summary(terminalreporter, exitstatus):
    """This function has meaning to pytest, for more information, see:
    https://docs.pytest.org/en/stable/reference.html#pytest.hookspec.pytest_terminal_summary
    """
    if not MockAsyncHTTPClient.records:
        return
    hosts = defaultdict(dict)
    # group records by host
    for url, response in MockAsyncHTTPClient.records.items():
        host = urlparse(url).hostname
        hosts[host][url] = response
    # save records to files
    for host, records in hosts.items():
        fname = f"http-record.{host}.json"
        print(f"Recorded http responses for {host} in {fname}")
        print(
            "To update the recordings used by the tests you will have"
            " to move or merge the newly created recordings with existing"
            f" recordings in {here}."
        )

        # Always store newly created recordings in the root directory
        # and ask a human to decide if they want to overwrite or merge
        # them with existing recordings
        with open(os.path.join(root, fname), "w") as f:
            json.dump(records, f, sort_keys=True, indent=1)
This function has meaning to pytest, for more information, see:
    https://docs.pytest.org/en/stable/reference.html#pytest.hookspec.pytest_terminal_summary
    
binderhub/tests/conftest.py