Args: keys(list): list of collection keys to freeze. Returns: a context where the collections are in the end restored to its initial state.
(keys)
| 48 | |
| 49 | @contextmanager |
| 50 | def freeze_collection(keys): |
| 51 | """ |
| 52 | Args: |
| 53 | keys(list): list of collection keys to freeze. |
| 54 | |
| 55 | Returns: |
| 56 | a context where the collections are in the end restored to its initial state. |
| 57 | """ |
| 58 | backup = backup_collection(keys) |
| 59 | yield |
| 60 | restore_collection(backup) |
| 61 | |
| 62 | |
| 63 | @memoized |
nothing calls this directly
no test coverage detected