@contextmanager
def mock_registered_transformers(transformers):
 with patch('openedx.core.lib.block_structure.transformer_registry.TransformerRegistry.get_registered_transformers') as mock_available_transforms:
  mock_available_transforms.return_value = {transformer for transformer in transformers}
  (yield)

@ contextmanager def mock_registered_transformers ( transformers ) : with patch ( 'openedx.core.lib.block_structure.transformer_registry.TransformerRegistry.get_registered_transformers' ) as mock_available_transforms : mock_available_transforms . return_value = { transformer for transformer in transformers } ( yield )
context manager for mocking the transformer registry to return the given transformers .