Skip to content

Commit 2f1ab1f

Browse files
authored
Merge pull request #309 from koterpillar/cache-root-driver
chore(test): cache root driver
2 parents ee3acf2 + ca8ed0b commit 2f1ab1f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mybox/driver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from collections.abc import AsyncIterator, Callable, Iterable
44
from contextlib import AbstractAsyncContextManager, asynccontextmanager, nullcontext
55
from dataclasses import dataclass
6+
from functools import cache
67
from os import environ
78
from pathlib import Path
89
from typing import Any, Literal, Optional, cast
@@ -70,6 +71,7 @@ def __init__(self, *, root: bool = False) -> None:
7071
def deconstruct(self) -> dict:
7172
return {"root": self.root}
7273

74+
@cache
7375
def with_root(self, /, root: bool) -> "Driver":
7476
if self.root == root:
7577
return self

0 commit comments

Comments
 (0)