I've started developing a program that uses gitpython some weeks ago, and I had to spend a considerable amount of time deducing how to test it. I think it would be good to have a section in the official docs giving some insights.
I've published how I did it here. I don't know if it's the best approach, but if you like it, I can make a PR to include the content to the official docs.