From 1435382d5933ecff96ec9cdc7cfe3b829990f0e9 Mon Sep 17 00:00:00 2001 From: slawwan Date: Fri, 22 Nov 2024 13:10:06 +0500 Subject: [PATCH] removed example introduced for readme.md --- tests/test_serialization.py | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/tests/test_serialization.py b/tests/test_serialization.py index 19ba325..0bfce33 100644 --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -767,36 +767,3 @@ class GenericContainer(Generic[_TItem]): assert dumped == {"items": ["q", "w", "e"]} assert mr.load(GenericContainer[str], dumped) == container_str - - -def test_sdfdfsd(): - import dataclasses - from typing import Generic, TypeVar - - import marshmallow_recipe as mr - - T = TypeVar("T") - - @dataclasses.dataclass() - class Regular(Generic[T]): - value: T - - mr.dump(Regular[int](value=123)) # it works without explicit cls arg - - @dataclasses.dataclass(frozen=True) - class Frozen(Generic[T]): - value: T - - mr.dump(Frozen[int](value=123), cls=Frozen[int]) # cls required generic frozen - - @dataclasses.dataclass(slots=True) - class Slots(Generic[T]): - value: T - - mr.dump(Slots[int](value=123), cls=Slots[int]) # cls required for generic with slots - - @dataclasses.dataclass(slots=True) - class SlotsNonGeneric(Slots[int]): - pass - - mr.dump(SlotsNonGeneric(value=123)) # cls not required