Throw an exception on invalid BufferView instantiation

Also adjust tests to skip mmap under Python 2.
This commit is contained in:
Jason Paryani
2016-03-04 12:42:45 -08:00
parent aabd61301c
commit 2be308db27
2 changed files with 8 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import test_regression
import tempfile
import pickle
import mmap
import sys
this_dir = os.path.dirname(__file__)
@@ -41,6 +42,7 @@ def test_roundtrip_bytes(all_types):
msg = all_types.TestAllTypes.from_bytes(message_bytes)
test_regression.check_all_types(msg)
@pytest.mark.skipif(sys.version_info.major < 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)