LANGUAGE » PYTHON » PACKAGE

Importlib

Reimport

Available in Python >= 3.4.

Useful when mocking, where we may need to reimport to apply mocks created in runtime.

python
from importlib import reload
reload(module)