it seems, the editor runs unit tests from the file as it is on disk. Could the user be notified of unsaved changes before running tests? I just spent some quality time trying to understand, why my assertions failed when I realized, that... ;-)
In the Editor Preferences dialog (on Windows: Options → Preferences), you can choose the option "Save before executing files". Maybe this will make your life easier.