Download tests/conftest.py from soiz1/omegaconf: direct link, hf CLI and curl.
- Browser
- Download file 487 Bytes
-
https://huggingface.co/datasets/soiz1/omegaconf/resolve/main/tests/conftest.py
- Command line
-
hf download hf://datasets/soiz1/omegaconf/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/datasets/soiz1/omegaconf/resolve/main/tests/conftest.py
487 Bytes
| import copy | |
| from typing import Any | |
| import pytest | |
| from omegaconf.basecontainer import BaseContainer | |
| # type: ignore | |
| def restore_resolvers() -> Any: | |
| """ | |
| A fixture to restore singletons state after this the function. | |
| This is useful for functions that are making a one-off change to singlestons that should not effect | |
| other tests | |
| """ | |
| state = copy.deepcopy(BaseContainer._resolvers) | |
| yield | |
| BaseContainer._resolvers = state | |