feat(order_utils.py): schema resolver cache (#1317)

* Implemented basic functionality for using cache layer of LocalRefResolver

* Use `importlib` instead of `imp`, since it's been deprecated. Legacy `load_module()` reloads modules even if they are already imported, causing tests to fail when run in non-deterministic ordering, so we replace it with `import_module()`
This commit is contained in:
Daniel Pyrathon
2018-11-30 09:59:37 -08:00
committed by F. Eugene Aumson
parent fc3641b499
commit a1d4aa66bc
4 changed files with 81 additions and 38 deletions

View File

@@ -1,5 +1,11 @@
from typing import Any, Dict
from typing import Any, Dict, Tuple
class RefResolver: pass
class RefResolver:
def resolve(self, url: str) -> Tuple[str, Dict]:
...
class ValidationError(Exception): pass
def validate(instance: Any, schema: Dict, cls=None, *args, **kwargs) -> None: pass