Skip to content

Commit

Permalink
TST: failing test on py3k in test_expressions, trying to use 'div' op…
Browse files Browse the repository at this point in the history
…erator
  • Loading branch information
jreback committed Jun 5, 2013
1 parent eef04cc commit c278ca6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pandas/tests/test_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ def testit():

for op, op_str in [('add','+'),('sub','-'),('mul','*'),('div','/'),('pow','**')]:

op = getattr(operator,op)
result = expr._can_use_numexpr(op, op_str, f, f, 'evaluate')
self.assert_(result == (not f._is_mixed_type))

result = expr.evaluate(op, op_str, f, f, use_numexpr=True)
expected = expr.evaluate(op, op_str, f, f, use_numexpr=False)
assert_array_equal(result,expected.values)
op = getattr(operator,op,None)
if op is not None:
result = expr._can_use_numexpr(op, op_str, f, f, 'evaluate')
self.assert_(result == (not f._is_mixed_type))

result = expr.evaluate(op, op_str, f, f, use_numexpr=True)
expected = expr.evaluate(op, op_str, f, f, use_numexpr=False)
assert_array_equal(result,expected.values)

result = expr._can_use_numexpr(op, op_str, f2, f2, 'evaluate')
self.assert_(result == False)
result = expr._can_use_numexpr(op, op_str, f2, f2, 'evaluate')
self.assert_(result == False)


expr.set_use_numexpr(False)
Expand Down

0 comments on commit c278ca6

Please sign in to comment.