Remove dead helpers
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import os
|
||||
import platform
|
||||
import tempfile
|
||||
|
||||
import pytest
|
||||
@@ -59,10 +58,6 @@ def test_large_read_multiple_bytes(test_capnp):
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
platform.python_implementation() == "PyPy",
|
||||
reason="PyPy memoryview support is limited",
|
||||
)
|
||||
def test_large_read_mutltiple_bytes_memoryview(test_capnp):
|
||||
data = get_two_adjacent_messages(test_capnp)
|
||||
for m in test_capnp.Msg.read_multiple_bytes(memoryview(data)):
|
||||
|
||||
@@ -4,15 +4,9 @@ import pytest
|
||||
import capnp
|
||||
import os
|
||||
import math
|
||||
import sys
|
||||
|
||||
this_dir = os.path.dirname(__file__)
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
EXPECT_BYTES = True
|
||||
else:
|
||||
EXPECT_BYTES = False
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def addressbook():
|
||||
@@ -351,10 +345,7 @@ def check_all_types(reader):
|
||||
assert subReader.textField == "☃"
|
||||
# This assertion highlights the encoding we expect to see here, since
|
||||
# otherwise this appears a bit magical...
|
||||
if EXPECT_BYTES:
|
||||
assert len(subReader.textField) == 3
|
||||
else:
|
||||
assert len(subReader.textField) == 1
|
||||
assert len(subReader.textField) == 1
|
||||
|
||||
assert subReader.dataField == b"qux"
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import test_regression
|
||||
import tempfile
|
||||
import pickle
|
||||
import mmap
|
||||
import sys
|
||||
|
||||
this_dir = os.path.dirname(__file__)
|
||||
|
||||
@@ -27,10 +26,6 @@ def test_roundtrip_bytes(all_types):
|
||||
test_regression.check_all_types(msg)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.version_info[0] < 3,
|
||||
reason="mmap doesn't implement the buffer interface under python 2.",
|
||||
)
|
||||
def test_roundtrip_bytes_mmap(all_types):
|
||||
msg = all_types.TestAllTypes.new_message()
|
||||
test_regression.init_all_types(msg)
|
||||
|
||||
@@ -2,7 +2,6 @@ import pytest
|
||||
import capnp
|
||||
import os
|
||||
import tempfile
|
||||
import sys
|
||||
|
||||
from capnp.lib.capnp import KjException
|
||||
|
||||
@@ -42,9 +41,6 @@ def test_which_builder(addressbook):
|
||||
with pytest.raises(KjException):
|
||||
addresses._which()
|
||||
|
||||
with pytest.raises(KjException):
|
||||
addresses._which_str()
|
||||
|
||||
with pytest.raises(KjException):
|
||||
addresses.which
|
||||
|
||||
@@ -78,9 +74,6 @@ def test_which_reader(addressbook):
|
||||
bob = people[1]
|
||||
assert bob.employment.which == "unemployed"
|
||||
|
||||
with pytest.raises(KjException):
|
||||
addresses._which_str()
|
||||
|
||||
with pytest.raises(KjException):
|
||||
addresses._which()
|
||||
|
||||
@@ -88,10 +81,6 @@ def test_which_reader(addressbook):
|
||||
addresses.which
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
capnp.version.LIBCAPNP_VERSION < 5000,
|
||||
reason="Using ints as enums requires v0.5.0+ of the C++ capnp library",
|
||||
)
|
||||
def test_enum(addressbook):
|
||||
addresses = addressbook.AddressBook.new_message()
|
||||
people = addresses.init("people", 2)
|
||||
@@ -150,14 +139,8 @@ def test_null_str(all_types):
|
||||
def test_unicode_str(all_types):
|
||||
msg = all_types.TestAllTypes.new_message()
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
msg.textField = "f\u00e6oo".encode("utf-8")
|
||||
|
||||
assert msg.textField.decode("utf-8") == "f\u00e6oo"
|
||||
else:
|
||||
msg.textField = "f\u00e6oo"
|
||||
|
||||
assert msg.textField == "f\u00e6oo"
|
||||
msg.textField = "fæoo"
|
||||
assert msg.textField == "fæoo"
|
||||
|
||||
|
||||
def test_new_message(all_types):
|
||||
|
||||
Reference in New Issue
Block a user