mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-04 14:33:21 +08:00
Don't use unittest in tests (Python 2 compat)
This commit is contained in:
parent
006d8b6621
commit
88239ef83d
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import unittest
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from example import (
|
from example import (
|
||||||
create_rec_simple, create_rec_packed, create_rec_nested, print_format_descriptors,
|
create_rec_simple, create_rec_packed, create_rec_nested, print_format_descriptors,
|
||||||
@ -14,8 +13,11 @@ from example import (
|
|||||||
def check_eq(arr, data, dtype):
|
def check_eq(arr, data, dtype):
|
||||||
np.testing.assert_equal(arr, np.array(data, dtype=dtype))
|
np.testing.assert_equal(arr, np.array(data, dtype=dtype))
|
||||||
|
|
||||||
unittest.TestCase().assertRaisesRegex(
|
try:
|
||||||
RuntimeError, 'unsupported buffer format', get_format_unbound)
|
get_format_unbound()
|
||||||
|
raise Exception
|
||||||
|
except RuntimeError as e:
|
||||||
|
assert 'unsupported buffer format' in str(e)
|
||||||
|
|
||||||
print_format_descriptors()
|
print_format_descriptors()
|
||||||
print_dtypes()
|
print_dtypes()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user