mirror of
https://github.com/hanzo-ds/driver.git
synced 2026-10-30 20:32:40 +00:00
24 lines
617 B
Python
24 lines
617 B
Python
try:
|
|
import numpy as np
|
|
except ImportError:
|
|
np = None
|
|
|
|
from tests.numpy.util import check_numpy
|
|
from tests.testcase import BaseTestCase
|
|
|
|
|
|
class NumpyBaseTestCase(BaseTestCase):
|
|
client_kwargs = {'settings': {'use_numpy': True}}
|
|
|
|
@check_numpy
|
|
def setUp(self):
|
|
super(NumpyBaseTestCase, self).setUp()
|
|
|
|
def assertArraysEqual(self, first, second):
|
|
return self.assertTrue((first == second).all())
|
|
|
|
def assertArraysListEqual(self, first, second):
|
|
self.assertEqual(len(first), len(second))
|
|
for x, y in zip(first, second):
|
|
self.assertTrue((x == y).all())
|