Skip to content

Commit

Permalink
Merge pull request #309 from koterpillar/cache-root-driver
Browse files Browse the repository at this point in the history
chore(test): cache root driver
  • Loading branch information
koterpillar authored Jan 9, 2025
2 parents ee3acf2 + ca8ed0b commit 2f1ab1f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mybox/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from collections.abc import AsyncIterator, Callable, Iterable
from contextlib import AbstractAsyncContextManager, asynccontextmanager, nullcontext
from dataclasses import dataclass
from functools import cache
from os import environ
from pathlib import Path
from typing import Any, Literal, Optional, cast
Expand Down Expand Up @@ -70,6 +71,7 @@ def __init__(self, *, root: bool = False) -> None:
def deconstruct(self) -> dict:
return {"root": self.root}

@cache
def with_root(self, /, root: bool) -> "Driver":
if self.root == root:
return self
Expand Down

0 comments on commit 2f1ab1f

Please sign in to comment.