mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-11 17:00:34 +00:00
Add a test for buffer format of unbound struct
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import unittest
|
||||
import numpy as np
|
||||
from example import (
|
||||
create_rec_simple, create_rec_packed, create_rec_nested, print_format_descriptors,
|
||||
print_rec_simple, print_rec_packed, print_rec_nested, print_dtypes
|
||||
print_rec_simple, print_rec_packed, print_rec_nested, print_dtypes, get_format_unbound
|
||||
)
|
||||
|
||||
|
||||
def check_eq(arr, data, dtype):
|
||||
np.testing.assert_equal(arr, np.array(data, dtype=dtype))
|
||||
|
||||
unittest.TestCase().assertRaisesRegex(
|
||||
RuntimeError, 'unsupported buffer format', get_format_unbound)
|
||||
|
||||
print_format_descriptors()
|
||||
print_dtypes()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user