File: testcase.py

package info (click to toggle)
python-clickhouse-driver 0.2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,516 kB
  • sloc: python: 10,950; pascal: 42; makefile: 31; sh: 3
file content (23 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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())