def make_testitem(nodeid, keywords, location):
    """Return JSON-serializable test item."""
    item = {
        'nodeid': nodeid,
        'lineno': location[1],
        # The outcome will be overridden in case of failure
        'outcome': 'passed',
    }
    if keywords:
        item['keywords'] = keywords
    return item