mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
fix(unittest): Parallel Test failure because of shared memory (#7729)
Co-authored-by: Carlos Freund <carlosfreund@gmail.com>
This commit is contained in:
@@ -3,14 +3,14 @@ import os
|
|||||||
from openhands.core.logger import openhands_logger as logger
|
from openhands.core.logger import openhands_logger as logger
|
||||||
from openhands.storage.files import FileStore
|
from openhands.storage.files import FileStore
|
||||||
|
|
||||||
IN_MEMORY_FILES: dict = {}
|
|
||||||
|
|
||||||
|
|
||||||
class InMemoryFileStore(FileStore):
|
class InMemoryFileStore(FileStore):
|
||||||
files: dict[str, str]
|
files: dict[str, str]
|
||||||
|
|
||||||
def __init__(self, files: dict[str, str] = IN_MEMORY_FILES):
|
def __init__(self, files: dict[str, str] | None = None) -> None:
|
||||||
self.files = files
|
self.files = {}
|
||||||
|
if files is not None:
|
||||||
|
self.files = files
|
||||||
|
|
||||||
def write(self, path: str, contents: str | bytes) -> None:
|
def write(self, path: str, contents: str | bytes) -> None:
|
||||||
if isinstance(contents, bytes):
|
if isinstance(contents, bytes):
|
||||||
|
|||||||
Reference in New Issue
Block a user