pi_portal.modules.python.rpi.patch.patch_module

pi_portal.modules.python.rpi.patch.patch_module(module_name: str, substitute_module: str | None = None) None[source]

Mock or substitute an import if not running on the ‘arm’ platform.

If substitute_module is None, the module will be mocked. Otherwise, the module will be replaced.

Parameters:
  • module_name (str) – The module to import.

  • substitute_module (str | None) – An optional module to substitute for the import.