Skip to content

Commit

Permalink
Increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatal1ty committed Jan 15, 2021
1 parent 509146a commit 906d0a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ def test_hook_in_parent_class(mocker):
class A:
@classmethod
def __pre_deserialize__(cls, d):
return d
return d # pragma no cover

@classmethod
def __post_deserialize__(cls, obj):
return obj
return obj # pragma no cover

def __pre_serialize__(self):
return self
return self # pragma no cover

def __post_serialize__(self, d):
return d
return d # pragma no cover

@dataclass
class B(A, DataClassDictMixin):
Expand Down
6 changes: 6 additions & 0 deletions tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
is_generic,
is_init_var,
)
from mashumaro.serializer.base.metaprogramming import CodeBuilder


def test_is_generic_unsupported_python():
Expand Down Expand Up @@ -77,3 +78,8 @@ def foobar(self):
assert get_class_that_define_method("foo", B) == A
assert get_class_that_define_method("bar", B) == A
assert get_class_that_define_method("foobar", B) == B


def test_get_unknown_declared_hook():
builder = CodeBuilder(object)
assert builder.get_declared_hook("unknown_name") is None

0 comments on commit 906d0a7

Please sign in to comment.