mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Add lru cache to loading fixtures in tests (#87634)
This commit is contained in:
parent
720f51657d
commit
20b60d57f2
@ -7,6 +7,7 @@ from collections.abc import Awaitable, Callable, Collection, Mapping, Sequence
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
import functools as ft
|
import functools as ft
|
||||||
|
from functools import lru_cache
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
@ -502,6 +503,7 @@ def get_fixture_path(filename: str, integration: str | None = None) -> pathlib.P
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache
|
||||||
def load_fixture(filename: str, integration: str | None = None) -> str:
|
def load_fixture(filename: str, integration: str | None = None) -> str:
|
||||||
"""Load a fixture."""
|
"""Load a fixture."""
|
||||||
return get_fixture_path(filename, integration).read_text()
|
return get_fixture_path(filename, integration).read_text()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user