• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hgrecco / serialize / 7080427447

04 Dec 2023 12:33AM UTC coverage: 83.051% (-5.8%) from 88.857%
7080427447

push

github

hgrecco
Fix README testing

8 of 8 new or added lines in 1 file covered. (100.0%)

34 existing lines in 9 files now uncovered.

343 of 413 relevant lines covered (83.05%)

3.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/serialize/msgpack.py
1
# -*- coding: utf-8 -*-
2
"""
4✔
3
    serialize.msgpack
4
    ~~~~~~~~~~~~~~~~~
5

6
    Helpers for Msgpack Serialization.
7

8
    See https://pypi.python.org/pypi/msgpack-python for more details.
9

10
    :copyright: (c) 2016 by Hernan E. Grecco.
11
    :license: BSD, see LICENSE for more details.
12
"""
13

14
from . import all
4✔
15

16
try:
4✔
17
    import msgpack
4✔
UNCOV
18
except ImportError:
×
UNCOV
19
    all.register_unavailable("msgpack", pkg="msgpack-python")
×
UNCOV
20
    raise
×
21

22

23
def dumps(obj):
4✔
24
    return msgpack.packb(obj, default=all.encode)
4✔
25

26

27
def loads(content):
4✔
28
    return msgpack.unpackb(content, object_hook=all.decode, raw=False)
4✔
29

30

31
all.register_format("msgpack", dumps, loads)
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc