Commit 88239ef8 by Ivan Smirnov

Don't use unittest in tests (Python 2 compat)

parent 006d8b66
#!/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 ( ...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment