forked from python-openapi/openapi-schema-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_settings.py
More file actions
24 lines (19 loc) · 732 Bytes
/
Copy pathtest_settings.py
File metadata and controls
24 lines (19 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from openapi_schema_validator.settings import get_settings
from openapi_schema_validator.settings import reset_settings_cache
def test_compiled_validator_cache_size_env_is_cached(monkeypatch):
monkeypatch.setenv(
"OPENAPI_SCHEMA_VALIDATOR_COMPILED_VALIDATOR_CACHE_MAX_SIZE",
"11",
)
reset_settings_cache()
first = get_settings()
assert first.compiled_validator_cache_max_size == 11
monkeypatch.setenv(
"OPENAPI_SCHEMA_VALIDATOR_COMPILED_VALIDATOR_CACHE_MAX_SIZE",
"3",
)
second = get_settings()
assert second.compiled_validator_cache_max_size == 11
reset_settings_cache()
third = get_settings()
assert third.compiled_validator_cache_max_size == 3