You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a thought (when commenting on #62) that when trying to import GPIO, on an import error we could switch it out for MagicMock. This would mean there wouldn't be any need to set Config.test_mode = True as the mock object would just silently 'run' GPIO methods.
@alxwrd Seems like an excellent idea, I didn't know this existed!
I'd quite like to keep the test mode config option because it could be handy when RPi.GPIOis installed, for if you wanted to just run a test script or something. Although this could just be done with something like:
I had a thought (when commenting on #62) that when trying to import
GPIO
, on an import error we could switch it out forMagicMock
. This would mean there wouldn't be any need to setConfig.test_mode = True
as the mock object would just silently 'run' GPIO methods.I'm not 100% on this as it feels a bit hacky to use a testing mock object in the main module. Thoughts?
The text was updated successfully, but these errors were encountered: