I am developing a python application that is deployed to a raspberry pi. It uses the RPi package which allows the application to connect to the GPIO of the Pi.
I am currently developing the application on Windows and firstly would like to be able to run the application on my windows PC but secondly when I write unit tests I would like to be able to run the tests autonomously and be able to change how the mock RPi behaves to simulate errors.
What are the best practices within python to substitute a package so that it runs normally on the Pi using the real RPi packages and also automatically runs the mocked package?