1
###################################################################
2
# Numexpr - Fast numerical array expression evaluator for NumPy.
5
# Author: See AUTHORS.txt
7
# See LICENSE.txt and LICENSES/*.txt for details about copyright and
9
####################################################################
16
array, arange, empty, zeros, int32, int64, uint16, complex_, float64, rec,
17
copy, ones_like, where, alltrue, linspace,
18
sum, prod, sqrt, fmod,
19
sin, cos, tan, arcsin, arccos, arctan, arctan2,
20
sinh, cosh, tanh, arcsinh, arccosh, arctanh,
21
log, log1p, log10, exp, expm1)
22
from numpy.testing import *
23
from numpy import shape, allclose, array_equal, ravel, isnan, isinf
26
from numexpr import E, NumExpr, evaluate, disassemble, use_vml
29
TestCase = unittest.TestCase
34
# Recommended minimum versions
35
minimum_numpy_version = "1.6"
37
class test_numexpr(TestCase):
40
numexpr.set_num_threads(self.nthreads)
42
def test_simple(self):
43
ex = 2.0 * E.a + 3.0 * E.b * E.c
44
sig = [('a', double), ('b', double), ('c', double)]
45
func = NumExpr(ex, signature=sig)
46
x = func(array([1., 2, 3]), array([4., 5, 6]), array([7., 8, 9]))
47
assert_array_equal(x, array([ 86., 124., 168.]))
49
def test_simple_expr_small_array(self):
53
assert_array_equal(x, y)
55
def test_simple_expr(self):
59
assert_array_equal(x, y)
61
def test_rational_expr(self):
62
func = NumExpr((E.a + 2.0*E.b) / (1 + E.a + 4*E.b*E.b))
65
x = (a + 2*b) / (1 + a + 4*b*b)
67
assert_array_almost_equal(x, y)
69
def test_reductions(self):
70
# Check that they compile OK.
71
assert_equal(disassemble(
72
NumExpr("sum(x**2+2, axis=None)", [('x', double)])),
73
[('mul_ddd', 't3', 'r1[x]', 'r1[x]'),
74
('add_ddd', 't3', 't3', 'c2[2.0]'),
75
('sum_ddn', 'r0', 't3', None)])
76
assert_equal(disassemble(
77
NumExpr("sum(x**2+2, axis=1)", [('x', double)])),
78
[('mul_ddd', 't3', 'r1[x]', 'r1[x]'),
79
('add_ddd', 't3', 't3', 'c2[2.0]'),
80
('sum_ddn', 'r0', 't3', 1)])
81
assert_equal(disassemble(
82
NumExpr("prod(x**2+2, axis=2)", [('x', double)])),
83
[('mul_ddd', 't3', 'r1[x]', 'r1[x]'),
84
('add_ddd', 't3', 't3', 'c2[2.0]'),
85
('prod_ddn', 'r0', 't3', 2)])
86
# Check that full reductions work.
87
x = zeros(1e5)+.01 # checks issue #41
88
assert_allclose(evaluate("sum(x+2,axis=None)"), sum(x+2,axis=None))
89
assert_allclose(evaluate("sum(x+2,axis=0)"), sum(x+2,axis=0))
90
assert_allclose(evaluate("prod(x,axis=0)"), prod(x,axis=0))
93
assert_allclose(evaluate("sum(x**2+2,axis=0)"), sum(x**2+2,axis=0))
94
assert_allclose(evaluate("prod(x**2+2,axis=0)"), prod(x**2+2,axis=0))
97
assert_allclose(evaluate("sum(x**2+2,axis=0)"), sum(x**2+2,axis=0))
98
assert_allclose(evaluate("prod(x-1,axis=0)"), prod(x-1,axis=0))
99
x = linspace(0.1,1.0,2000)
100
assert_allclose(evaluate("sum(x**2+2,axis=0)"), sum(x**2+2,axis=0))
101
assert_allclose(evaluate("prod(x-1,axis=0)"), prod(x-1,axis=0))
103
# Check that reductions along an axis work
104
y = arange(9.0).reshape(3,3)
105
assert_allclose(evaluate("sum(y**2, axis=1)"), sum(y**2, axis=1))
106
assert_allclose(evaluate("sum(y**2, axis=0)"), sum(y**2, axis=0))
107
assert_allclose(evaluate("sum(y**2, axis=None)"), sum(y**2, axis=None))
108
assert_allclose(evaluate("prod(y**2, axis=1)"), prod(y**2, axis=1))
109
assert_allclose(evaluate("prod(y**2, axis=0)"), prod(y**2, axis=0))
110
assert_allclose(evaluate("prod(y**2, axis=None)"), prod(y**2, axis=None))
114
assert_allclose(evaluate("sum(x**2+2,axis=0)"), sum(x**2+2,axis=0))
115
assert_allclose(evaluate("prod(x**2+2,axis=0)"), prod(x**2+2,axis=0))
118
assert_allclose(evaluate("sum(x**2+2,axis=0)"), sum(x**2+2,axis=0))
119
assert_allclose(evaluate("prod(x**2+2,axis=0)"), prod(x**2+2,axis=0))
122
assert_allclose(evaluate("sum(x**2+2,axis=0)"), sum(x**2+2,axis=0))
123
assert_allclose(evaluate("prod(x-1,axis=0)"), prod(x-1,axis=0))
126
y = arange(9.0).reshape(3,3)
128
evaluate("sum(y, axis=2)")
132
raise ValueError("should raise exception!")
134
evaluate("sum(y, axis=-3)")
138
raise ValueError("should raise exception!")
140
# Negative axis are not supported
141
evaluate("sum(y, axis=-1)")
145
raise ValueError("should raise exception!")
147
def test_r0_reuse(self):
148
assert_equal(disassemble(NumExpr("x * x + 2", [('x', double)])),
149
[('mul_ddd', 'r0', 'r1[x]', 'r1[x]'),
150
('add_ddd', 'r0', 'r0', 'c2[2.0]')])
153
class test_numexpr1(test_numexpr):
154
"""Testing with 1 thread"""
157
class test_numexpr2(test_numexpr):
158
"""Testing with 2 threads"""
162
class test_evaluate(TestCase):
163
def test_simple(self):
164
a = array([1., 2., 3.])
165
b = array([4., 5., 6.])
166
c = array([7., 8., 9.])
167
x = evaluate("2*a + 3*b*c")
168
assert_array_equal(x, array([ 86., 124., 168.]))
170
def test_simple_expr_small_array(self):
173
assert_array_equal(x, y)
175
def test_simple_expr(self):
178
assert_array_equal(x, y)
181
def test_zero_div(self):
182
x = arange(100, dtype='i4')
184
x2 = zeros(100, dtype='i4')
186
assert_array_equal(x2, y)
189
def test_true_div(self):
190
x = arange(10, dtype='i4')
191
assert_array_equal(evaluate("x/2"), x / 2)
192
assert_array_equal(evaluate("x/2", truediv=False), x / 2)
193
assert_array_equal(evaluate("x/2", truediv='auto'), x / 2)
194
assert_array_equal(evaluate("x/2", truediv=True), x / 2.0)
196
# PyTables uses __nonzero__ among ExpressionNode objects internally
197
# so this should be commented out for the moment. See #24.
198
def _test_boolean_operator(self):
199
x = arange(10, dtype='i4')
201
evaluate("(x > 1) and (x < 9)")
205
raise ValueError("should raise exception!")
207
def test_rational_expr(self):
209
b = arange(1e6) * 0.1
210
x = (a + 2*b) / (1 + a + 4*b*b)
211
y = evaluate("(a + 2*b) / (1 + a + 4*b*b)")
212
assert_array_almost_equal(x, y)
214
def test_complex_expr(self):
216
c = zeros(a.shape, dtype=complex_)
221
b = arange(1e4)**1e-5
224
x = sin(complex(a, b)).real + z.imag
225
y = evaluate("sin(complex(a, b)).real + z.imag")
226
assert_array_almost_equal(x, y)
228
def test_complex_strides(self):
229
a = arange(100).reshape(10,10)[::2]
230
b = arange(50).reshape(5,10)
231
assert_array_equal(evaluate("a+b"), a+b)
232
c = empty([10], dtype=[('c1', int32), ('c2', uint16)])
237
assert_array_equal(evaluate("c1"), c1)
238
assert_array_equal(evaluate("a0+c1"), a0+c1)
240
def test_broadcasting(self):
241
a = arange(100).reshape(10,10)[::2]
243
d = arange(5).reshape(5,1)
244
assert_array_equal(evaluate("a+c"), a+c)
245
assert_array_equal(evaluate("a+d"), a+d)
246
expr = NumExpr("2.0*a+3.0*c",[('a', double),('c', double)])
247
assert_array_equal(expr(a,c), 2.0*a+3.0*c)
249
def test_all_scalar(self):
252
assert_allclose(evaluate("a+b"), a+b)
253
expr = NumExpr("2*a+3*b",[('a', double),('b', double)])
254
assert_equal(expr(a,b), 2*a+3*b)
257
a = arange(100).reshape(10,10)[::2]
259
expr = NumExpr("2*a+3*b",[('a', double),('b', double)])
260
assert_array_equal(expr(a,b), expr.run(a,b))
262
def test_illegal_value(self):
265
evaluate("a < [0, 0, 0]")
271
# Execution order set here so as to not use too many threads
272
# during the rest of the execution. See #33 for details.
273
def test_changing_nthreads_00_inc(self):
274
a = linspace(-1, 1, 1e6)
275
b = ((.25*a + .75)*a - 1.5)*a - 2
276
for nthreads in range(1,7):
277
numexpr.set_num_threads(nthreads)
278
c = evaluate("((.25*a + .75)*a - 1.5)*a - 2")
279
assert_array_almost_equal(b, c)
281
def test_changing_nthreads_01_dec(self):
282
a = linspace(-1, 1, 1e6)
283
b = ((.25*a + .75)*a - 1.5)*a - 2
284
for nthreads in range(6, 1, -1):
285
numexpr.set_num_threads(nthreads)
286
c = evaluate("((.25*a + .75)*a - 1.5)*a - 2")
287
assert_array_almost_equal(b, c)
295
'2*a + (cos(3)+5)*sinh(cos(b))',
296
'2*a + arctan2(a, b)',
298
'where(a != 0.0, 2, a)',
299
'where(a > 10, b < a, b > a)',
300
'where((a-10).real != 0.0, a, 2)',
301
'0.25 * (a < 5) + 0.33 * (a >= 5)',
309
for op in list('+-*/%') + ['**']:
310
optests.append("(a+1) %s (b+3)" % op)
311
optests.append("3 %s (b+3)" % op)
312
optests.append("(a+1) %s 4" % op)
313
optests.append("2 %s (b+3)" % op)
314
optests.append("(a+1) %s 2" % op)
315
optests.append("(a+1) %s -1" % op)
316
optests.append("(a+1) %s 0.5" % op)
317
tests.append(('OPERATIONS', optests))
320
for op in ['<', '<=', '==', '>=', '>', '!=']:
321
cmptests.append("a/2+5 %s b" % op)
322
cmptests.append("a/2+5 %s 7" % op)
323
cmptests.append("7 %s b" % op)
324
cmptests.append("7.0 %s 5" % op)
325
tests.append(('COMPARISONS', cmptests))
328
for func in ['copy', 'ones_like', 'sqrt',
329
'sin', 'cos', 'tan', 'arcsin', 'arccos', 'arctan',
330
'sinh', 'cosh', 'tanh', 'arcsinh', 'arccosh', 'arctanh',
331
'log', 'log1p', 'log10', 'exp', 'expm1', 'abs']:
332
func1tests.append("a + %s(b+c)" % func)
333
tests.append(('1_ARG_FUNCS', func1tests))
336
for func in ['arctan2', 'fmod']:
337
func2tests.append("a + %s(b+c, d+1)" % func)
338
func2tests.append("a + %s(b+c, 1)" % func)
339
func2tests.append("a + %s(1, d+1)" % func)
340
tests.append(('2_ARG_FUNCS', func2tests))
343
# n = -1, 0.5, 2, 4 already handled in section "OPERATIONS"
344
for n in (-7, -2.5, -1.5, -1.3, -.5, 0, 0.0, 1, 2.3, 2.5, 3):
345
powtests.append("(a+1)**%s" % n)
346
tests.append(('POW_TESTS', powtests))
348
def equal(a, b, exact):
349
if array_equal(a, b):
352
if hasattr(a, 'dtype') and a.dtype in ['f4','f8']:
353
nnans = isnan(a).sum()
355
# For results containing NaNs, just check that the number
356
# of NaNs is the same in both arrays. This check could be
357
# made more exhaustive, but checking element by element in
358
# python space is very expensive in general.
359
return nnans == isnan(b).sum()
360
ninfs = isinf(a).sum()
363
return ninfs == isinf(b).sum()
365
return (shape(a) == shape(b)) and alltrue(ravel(a) == ravel(b), axis=0)
367
if hasattr(a, 'dtype') and a.dtype == 'f4':
368
atol = 1e-5 # Relax precission for special opcodes, like fmod
371
return (shape(a) == shape(b) and
372
allclose(ravel(a), ravel(b), atol=atol))
374
class Skip(Exception): pass
376
def test_expressions():
378
def make_test_method(a, a2, b, c, d, e, x, expr,
379
test_scalar, dtype, optimization, exact, section):
380
this_locals = locals()
382
# We don't want to listen at RuntimeWarnings like
383
# "overflows" or "divide by zero". Feel free to expand
384
# the range for this filter, if needed.
385
if dtype.__name__ == "float32" or 'arctanh' in expr:
386
warnings.simplefilter("ignore")
387
npval = eval(expr, globals(), this_locals)
388
warnings.simplefilter("always")
390
npval = eval(expr, globals(), this_locals)
392
neval = evaluate(expr, local_dict=this_locals,
393
optimization=optimization)
394
assert equal(npval, neval, exact), """%r
395
(test_scalar=%r, dtype=%r, optimization=%r, exact=%r,
396
npval=%r (%r - %r)\n neval=%r (%r - %r))""" % (expr, test_scalar, dtype.__name__,
398
npval, type(npval), shape(npval),
399
neval, type(neval), shape(neval))
400
except AssertionError:
402
except NotImplementedError:
403
print('%r not implemented for %s (scalar=%d, opt=%s)'
404
% (expr, dtype.__name__, test_scalar, optimization))
406
print('numexpr error for expression %r' % (expr,))
408
method.description = ('test_expressions(%s, test_scalar=%r, '
409
'dtype=%r, optimization=%r, exact=%r)') \
410
% (expr, test_scalar, dtype.__name__, optimization, exact)
412
method.__name__ = 'test_scalar%d_%s_%s_%s_%04d' % (test_scalar,
419
for test_scalar in (0, 1, 2):
420
for dtype in (int, long, numpy.float32, double, complex):
422
a = arange(2*array_size, dtype=dtype)[::2]
423
a2 = zeros([array_size, array_size], dtype=dtype)
424
b = arange(array_size, dtype=dtype) / array_size
425
c = arange(array_size, dtype=dtype)
426
d = arange(array_size, dtype=dtype)
427
e = arange(array_size, dtype=dtype)
430
for x in [a2, b, c, d, e]:
434
a = a[array_size / 2]
436
b = b[array_size / 2]
437
for optimization, exact in [
438
('none', False), ('moderate', False), ('aggressive', False)]:
439
for section_name, section_tests in tests:
440
for expr in section_tests:
441
if dtype == complex and (
442
'<' in expr or '>' in expr or '%' in expr
443
or "arctan2" in expr or "fmod" in expr):
444
# skip complex comparisons or functions not
445
# defined in complex domain.
447
if (dtype in (int, long) and test_scalar and
448
expr == '(a+1) ** -1'):
451
m = make_test_method(a, a2, b, c, d, e, x,
452
expr, test_scalar, dtype,
457
class test_int64(TestCase):
459
a = array([2**31-1, 2**31, 2**32, 2**63-1], dtype=int64)
461
assert_array_equal(res, [1-2**31, -(2**31), -(2**32), 1-2**63])
462
self.assertEqual(res.dtype.name, 'int64')
464
class test_int32_int64(TestCase):
465
def test_small_long(self):
466
# Small longs should not be downgraded to ints.
467
res = evaluate('42L')
468
assert_array_equal(res, 42)
469
self.assertEqual(res.dtype.name, 'int64')
471
def test_big_int(self):
472
# Big ints should be promoted to longs.
473
# This test may only fail under 64-bit platforms.
474
res = evaluate('2**40')
475
assert_array_equal(res, 2**40)
476
self.assertEqual(res.dtype.name, 'int64')
478
def test_long_constant_promotion(self):
479
int32array = arange(100, dtype='int32')
481
res32 = evaluate('int32array * 2')
482
res64 = evaluate('int32array * 2L')
483
assert_array_equal(res, res32)
484
assert_array_equal(res, res64)
485
self.assertEqual(res32.dtype.name, 'int32')
486
self.assertEqual(res64.dtype.name, 'int64')
488
def test_int64_array_promotion(self):
489
int32array = arange(100, dtype='int32')
490
int64array = arange(100, dtype='int64')
491
respy = int32array * int64array
492
resnx = evaluate('int32array * int64array')
493
assert_array_equal(respy, resnx)
494
self.assertEqual(resnx.dtype.name, 'int64')
497
class test_uint32_int64(TestCase):
498
def test_small_uint32(self):
499
# Small uint32 should not be downgraded to ints.
502
assert_array_equal(res, 42)
503
self.assertEqual(res.dtype.name, 'int64')
505
def test_uint32_constant_promotion(self):
506
int32array = arange(100, dtype='int32')
509
res32 = evaluate('int32array * 2')
510
res64 = evaluate('int32array * a')
511
assert_array_equal(res, res32)
512
assert_array_equal(res, res64)
513
self.assertEqual(res32.dtype.name, 'int32')
514
self.assertEqual(res64.dtype.name, 'int64')
516
def test_int64_array_promotion(self):
517
uint32array = arange(100, dtype='uint32')
518
int64array = arange(100, dtype='int64')
519
respy = uint32array * int64array
520
resnx = evaluate('uint32array * int64array')
521
assert_array_equal(respy, resnx)
522
self.assertEqual(resnx.dtype.name, 'int64')
525
class test_strings(TestCase):
528
str_list1 = ['foo', 'bar', '', ' ']
529
str_list2 = ['foo', '', 'x', ' ']
530
str_nloops = len(str_list1) * (BLOCK_SIZE1 + BLOCK_SIZE2 + 1)
531
str_array1 = array(str_list1 * str_nloops)
532
str_array2 = array(str_list2 * str_nloops)
533
str_constant = 'doodoo'
535
def test_null_chars(self):
537
'\0\0\0', '\0\0foo\0', '\0\0foo\0b', '\0\0foo\0b\0',
538
'foo\0', 'foo\0b', 'foo\0b\0', 'foo\0bar\0baz\0\0' ]
541
self.assertEqual(s, r.tostring()) # check *all* stored data
543
def test_compare_copy(self):
544
sarr = self.str_array1
547
res2 = evaluate(expr)
548
assert_array_equal(res1, res2)
550
def test_compare_array(self):
551
sarr1 = self.str_array1
552
sarr2 = self.str_array2
553
expr = 'sarr1 >= sarr2'
555
res2 = evaluate(expr)
556
assert_array_equal(res1, res2)
558
def test_compare_variable(self):
559
sarr = self.str_array1
560
svar = self.str_constant
561
expr = 'sarr >= svar'
563
res2 = evaluate(expr)
564
assert_array_equal(res1, res2)
566
def test_compare_constant(self):
567
sarr = self.str_array1
568
expr = 'sarr >= %r' % self.str_constant
570
res2 = evaluate(expr)
571
assert_array_equal(res1, res2)
573
def test_add_string_array(self):
574
sarr1 = self.str_array1
575
sarr2 = self.str_array2
576
expr = 'sarr1 + sarr2'
577
self.assert_missing_op('add_sss', expr, locals())
579
def test_add_numeric_array(self):
580
sarr = self.str_array1
581
narr = arange(len(sarr), dtype='int32')
582
expr = 'sarr >= narr'
583
self.assert_missing_op('ge_bsi', expr, locals())
585
def assert_missing_op(self, op, expr, local_dict):
586
msg = "expected NotImplementedError regarding '%s'" % op
588
evaluate(expr, local_dict)
589
except NotImplementedError, nie:
590
if "'%s'" % op not in nie.args[0]:
595
def test_compare_prefix(self):
596
# Check comparing two strings where one is a prefix of the
598
for s1, s2 in [ ('foo', 'foobar'), ('foo', 'foo\0bar'),
599
('foo\0a', 'foo\0bar') ]:
600
self.assert_(evaluate('s1 < s2'))
601
self.assert_(evaluate('s1 <= s2'))
602
self.assert_(evaluate('~(s1 == s2)'))
603
self.assert_(evaluate('~(s1 >= s2)'))
604
self.assert_(evaluate('~(s1 > s2)'))
606
# Check for NumPy array-style semantics in string equality.
607
s1, s2 = 'foo', 'foo\0\0'
608
self.assert_(evaluate('s1 == s2'))
610
# Case for testing selections in fields which are aligned but whose
611
# data length is not an exact multiple of the length of the record.
612
# The following test exposes the problem only in 32-bit machines,
613
# because in 64-bit machines 'c2' is unaligned. However, this should
614
# check most platforms where, while not unaligned, 'len(datatype) >
615
# boundary_alignment' is fullfilled.
616
class test_irregular_stride(TestCase):
617
def test_select(self):
618
f0 = arange(10, dtype=int32)
619
f1 = arange(10, dtype=float64)
621
irregular = rec.fromarrays([f0, f1])
626
i0 = evaluate('f0 < 5')
627
i1 = evaluate('f1 < 5')
629
assert_array_equal(f0[i0], arange(5, dtype=int32))
630
assert_array_equal(f1[i1], arange(5, dtype=float64))
632
# Cases for testing arrays with dimensions that can be zero.
633
class test_zerodim(TestCase):
635
def test_zerodim1d(self):
636
a0 = array([], dtype=int32)
637
a1 = array([], dtype=float64)
639
r0 = evaluate('a0 + a1')
640
r1 = evaluate('a0 * a1')
642
assert_array_equal(r0, a1)
643
assert_array_equal(r1, a1)
645
def test_zerodim3d(self):
646
a0 = array([], dtype=int32).reshape(0,2,4)
647
a1 = array([], dtype=float64).reshape(0,2,4)
649
r0 = evaluate('a0 + a1')
650
r1 = evaluate('a0 * a1')
652
assert_array_equal(r0, a1)
653
assert_array_equal(r1, a1)
655
# Case test for threads
656
class test_threading(TestCase):
657
def test_thread(self):
659
class ThreadTest(threading.Thread):
662
assert_array_equal(evaluate('a**3'), array([0, 1, 8]))
666
# The worker function for the subprocess (needs to be here because Windows
667
# has problems pickling nested functions with the multiprocess module :-/)
668
def _worker(qout = None):
669
ra = numpy.arange(1e3)
670
rows = evaluate('ra > 0')
671
#print "Succeeded in evaluation!\n"
675
# Case test for subprocesses (via multiprocessing module)
676
class test_subprocess(TestCase):
677
def test_multiprocess(self):
679
import multiprocessing as mp
682
# Check for two threads at least
683
numexpr.set_num_threads(2)
684
#print "**** Running from main process:"
686
#print "**** Running from subprocess:"
688
ps = mp.Process(target=_worker, args=(qout,))
698
def print_versions():
699
"""Print the versions of software that numexpr relies on."""
700
if numpy.__version__ < minimum_numpy_version:
701
print "*Warning*: NumPy version is lower than recommended: %s < %s" % \
702
(numpy.__version__, minimum_numpy_version)
704
print "Numexpr version: %s" % numexpr.__version__
705
print "NumPy version: %s" % numpy.__version__
706
print 'Python version: %s' % sys.version
707
if os.name == 'posix':
708
(sysname, nodename, release, version, machine) = os.uname()
709
print 'Platform: %s-%s' % (sys.platform, machine)
710
print "AMD/Intel CPU? %s" % numexpr.is_cpu_amd_intel
711
print "VML available? %s" % use_vml
713
print "VML/MKL version: %s" % numexpr.get_vml_version()
714
print 'Detected cores: %s' % numexpr.ncores
720
Run all the tests in the test suite.
724
unittest.TextTestRunner().run(suite())
725
test.__test__ = False
731
theSuite = unittest.TestSuite()
734
class TestExpressions(TestCase):
737
def add_method(func):
740
setattr(TestExpressions, func.__name__,
741
new.instancemethod(method, None, TestExpressions))
743
for func in test_expressions():
746
for n in range(niter):
747
theSuite.addTest(unittest.makeSuite(test_numexpr1))
748
theSuite.addTest(unittest.makeSuite(test_numexpr2))
749
theSuite.addTest(unittest.makeSuite(test_evaluate))
750
theSuite.addTest(unittest.makeSuite(TestExpressions))
751
theSuite.addTest(unittest.makeSuite(test_int32_int64))
752
theSuite.addTest(unittest.makeSuite(test_uint32_int64))
753
theSuite.addTest(unittest.makeSuite(test_strings))
755
unittest.makeSuite(test_irregular_stride) )
756
theSuite.addTest(unittest.makeSuite(test_zerodim))
757
theSuite.addTest(unittest.makeSuite(test_subprocess))
758
# I need to put this test after test_subprocess because
759
# if not, the test suite locks immediately before test_subproces.
760
# This only happens with Windows, so I suspect of a subtle bad
761
# interaction with threads and subprocess :-/
762
theSuite.addTest(unittest.makeSuite(test_threading))
766
if __name__ == '__main__':
768
unittest.main(defaultTest = 'suite')
770
# unittest.TextTestRunner(verbosity=2).run(suite)