I managed to get something similar to work by adding this:
project = context.testCase.testSuite.project
project.save()
project.getWorkspace()
When I first run in from testrunner, I get no results. The second time I run it, it works.
I guess that somehow the workspace doesn't know about the dynamically created tests, that's why it works starting with the second time. Now, next step would be to find a way to 'reload' the project in the same run, in order to also have the results from the new dynamically created test cases. If I find a way to do it, I'll let you know, but any help is appreciated .