Here's the solution.
First thing, use the jira api to create a new issue of the "Test Execution" type:
fields_dict = {
'project': 'AB',
'summary': 'New execution',
'description': 'Test execution creation via python',
'issuetype': {'name': 'Test Execution'}
}
test_execution = jira.create_issue(fields = fields_dict)
Now we need to associate tests with this test execution. For this example, let's associate a single test called "AB-3". Don't forget to include auth details for this POST. You can associate test sets in the same manner, ie, "AB-3" could be a single test or a test set.
requests.post("https://my.jira.com/rest/raven/1.0/api/testexec/" + test_execution.key + "/test", json{"add": ["AB-3"]})
This creates a unique id for each test we have associated with this test execution. We will need this unique id to update the execution status.
r = requests.get("https://my.jira.com/rest/raven/1.0/api/testexec/" + test_execution.key
test_id = r.json()[0]['id']
If you have more than one test, use a loop of course. I'm just subscripting to the first item since I know we only have one test.
Then to update execution status, we do a PUT:
requests.put("https://my.jira.com/rest/raven/1.0/api/testrun/" + str(test_id) + "/status?status=PASS")
You can use "PASS" or "FAIL", etc. Don't forget to auth!