Cleanup code and pyproject (#608)

* use isort
* fallback: use BytesIO instead of StringIO. We had dropped Python 2
already.
This commit is contained in:
Inada Naoki 2024-05-06 11:46:31 +09:00 committed by GitHub
parent e0f0e145f1
commit 33e0e86f4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 75 additions and 80 deletions

View file

@ -1,6 +1,6 @@
from pytest import raises
from msgpack import packb, unpackb, Packer
from msgpack import Packer, packb, unpackb
def test_unpack_buffer():

View file

@ -1,10 +1,11 @@
#!/usr/bin/env python
from pytest import raises
from msgpack import packb, unpackb, Unpacker, FormatError, StackError, OutOfData
import datetime
from pytest import raises
from msgpack import FormatError, OutOfData, StackError, Unpacker, packb, unpackb
class DummyException(Exception):
pass

View file

@ -1,4 +1,5 @@
import array
import msgpack
from msgpack import ExtType

View file

@ -2,14 +2,14 @@
import pytest
from msgpack import (
packb,
unpackb,
Packer,
Unpacker,
ExtType,
Packer,
PackOverflowError,
PackValueError,
Unpacker,
UnpackValueError,
packb,
unpackb,
)

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python
from array import array
from msgpack import packb, unpackb

View file

@ -1,4 +1,4 @@
from msgpack import packb, unpackb, ExtType
from msgpack import ExtType, packb, unpackb
def test_str8():

View file

@ -1,6 +1,7 @@
#!/usr/bin/env python
from pytest import raises
from msgpack import packb, unpackb

View file

@ -1,12 +1,12 @@
#!/usr/bin/env python
import struct
from collections import OrderedDict
from io import BytesIO
import struct
import pytest
from msgpack import packb, unpackb, Unpacker, Packer
from msgpack import Packer, Unpacker, packb, unpackb
def check(data, use_list=False):

View file

@ -1,6 +1,6 @@
"""Test Unpacker's read_array_header and read_map_header methods"""
from msgpack import packb, Unpacker, OutOfData
from msgpack import OutOfData, Unpacker, packb
UnexpectedTypeException = ValueError

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python
# ruff: noqa: E501
# ignore line length limit for long comments
import io
import msgpack
import msgpack
binarydata = bytes(bytearray(range(256)))

View file

@ -1,10 +1,11 @@
#!/usr/bin/env python
import io
from msgpack import Unpacker, BufferFull
from msgpack import pack, packb
from msgpack.exceptions import OutOfData
from pytest import raises
from msgpack import BufferFull, Unpacker, pack, packb
from msgpack.exceptions import OutOfData
def test_partialdata():
unpacker = Unpacker()

View file

@ -1,5 +1,6 @@
from collections import namedtuple
from msgpack import packb, unpackb, ExtType
from msgpack import ExtType, packb, unpackb
def test_namedtuple():

View file

@ -1,8 +1,9 @@
#!/usr/bin/env python
from msgpack import packb
from collections import namedtuple
from msgpack import packb
class MyList(list):
pass

View file

@ -1,5 +1,7 @@
import pytest
import datetime
import pytest
import msgpack
from msgpack.ext import Timestamp

View file

@ -1,12 +1,9 @@
from io import BytesIO
import sys
from msgpack import Unpacker, packb, OutOfData, ExtType
from pytest import raises, mark
from io import BytesIO
try:
from itertools import izip as zip
except ImportError:
pass
from pytest import mark, raises
from msgpack import ExtType, OutOfData, Unpacker, packb
def test_unpack_array_header_from_file():