QgsMapCanvas test is rather messy, but I can't find anyway to avoid showing the canvas in order to get a predictable result