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 Mar 25, 2024
1 parent e52e32b commit 7e07c00
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 @@ -18,7 +18,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 @@ -479,6 +479,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)

Check warning on line 486 in pydra/utils/hash.py

View check run for this annotation

Codecov / codecov/patch

pydra/utils/hash.py#L486

Added line #L486 was not covered by tests


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

0 comments on commit 7e07c00

Please sign in to comment.