pre-commit-ci-lite[bot]
4 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
2 deletions
-
tests/test_responses_optional_imports.py
|
|
|
@ -13,9 +13,13 @@ def test_optional_imports_broken_installation(monkeypatch: pytest.MonkeyPatch) - |
|
|
|
|
|
|
|
def fake_import_module(name: str, package: str | None = None) -> Any: |
|
|
|
if name == "ujson": |
|
|
|
raise ImportError("simulated binary/load failure for ujson") # pragma: no cover |
|
|
|
raise ImportError( |
|
|
|
"simulated binary/load failure for ujson" |
|
|
|
) # pragma: no cover |
|
|
|
if name == "orjson": |
|
|
|
raise ImportError("simulated binary/load failure for orjson") # pragma: no cover |
|
|
|
raise ImportError( |
|
|
|
"simulated binary/load failure for orjson" |
|
|
|
) # pragma: no cover |
|
|
|
return real_import_module(name, package) |
|
|
|
|
|
|
|
monkeypatch.setattr(importlib, "import_module", fake_import_module) |
|
|
|
|