Add lru cache to loading fixtures in tests (#87634)
This commit is contained in:
parent
720f51657d
commit
20b60d57f2
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ from collections.abc import Awaitable, Callable, Collection, Mapping, Sequence
|
|||
from contextlib import contextmanager
|
||||
from datetime import datetime, timedelta, timezone
|
||||
import functools as ft
|
||||
from functools import lru_cache
|
||||
from io import StringIO
|
||||
import json
|
||||
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:
|
||||
"""Load a fixture."""
|
||||
return get_fixture_path(filename, integration).read_text()
|
||||
|
|
Loading…
Add table
Reference in a new issue