No need to reinvent the wheel, there's a std/production proved mock module! (it's part of python3 std Library iirc).
pip install mock You basically replace Maya entries on sys.modules by a MagicMock instance (check the docs for more info, there are convenience functions to do it and everything... mocking dependencies is a very common practice and is well documented). Hope this helps, Cheers -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPamJi-ARG9Amp3twfCcPY8m-%3DBw-HQpfZuZ1TTtnLitJsV-6A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
