Skip to content

Commit

Permalink
adds bytes repr implementation for mock fileset types to get pydra ta…
Browse files Browse the repository at this point in the history
…sk doctests to work
  • Loading branch information
tclose committed May 22, 2024
1 parent b6db19b commit ed43995
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pydra/utils/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from filelock import SoftFileLock
import attrs.exceptions
from fileformats.core import FileSet
from fileformats.core.fileset import FileSet, MockMixin
from . import user_cache_dir, add_exc_note

logger = logging.getLogger("pydra")
Expand Down Expand Up @@ -485,6 +485,13 @@ def bytes_repr_fileset(
yield from fileset.__bytes_repr__(cache)


@register_serializer(MockMixin)
def bytes_repr_mock_fileset(
mock_fileset: MockMixin, cache: Cache
) -> Iterator[ty.Union[CacheKey, bytes]]:
yield from mock_fileset.__bytes_repr__(cache)


@register_serializer(list)
@register_serializer(tuple)
def bytes_repr_seq(obj: Sequence, cache: Cache) -> Iterator[bytes]:
Expand Down

0 comments on commit ed43995

Please sign in to comment.