Oh, sorry, I'd forgotten that it needs to be unique for sys.modules as well as the file path. We could remove it from sys.modules in setUp/tearDown, but that's no simpler than just giving it a unique name, so never mind.