The test code results aren't being written anywhere- they're only being stored in the results dict but don't have an output handler associated with them. Easiest fix is to have them added to the results lines of the non-test code and then write that to the same file. But this might be annoying to users, since they'll have to move the test code out into a separate file.

Maybe if ```test_code``` is True, only write test code to the output file, and if not, write Command code?