Skip to content

Commit c278ca6

Browse files
committed
TST: failing test on py3k in test_expressions, trying to use 'div' operator
1 parent eef04cc commit c278ca6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pandas/tests/test_expressions.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,17 @@ def testit():
6969

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

72-
op = getattr(operator,op)
73-
result = expr._can_use_numexpr(op, op_str, f, f, 'evaluate')
74-
self.assert_(result == (not f._is_mixed_type))
75-
76-
result = expr.evaluate(op, op_str, f, f, use_numexpr=True)
77-
expected = expr.evaluate(op, op_str, f, f, use_numexpr=False)
78-
assert_array_equal(result,expected.values)
72+
op = getattr(operator,op,None)
73+
if op is not None:
74+
result = expr._can_use_numexpr(op, op_str, f, f, 'evaluate')
75+
self.assert_(result == (not f._is_mixed_type))
76+
77+
result = expr.evaluate(op, op_str, f, f, use_numexpr=True)
78+
expected = expr.evaluate(op, op_str, f, f, use_numexpr=False)
79+
assert_array_equal(result,expected.values)
7980

80-
result = expr._can_use_numexpr(op, op_str, f2, f2, 'evaluate')
81-
self.assert_(result == False)
81+
result = expr._can_use_numexpr(op, op_str, f2, f2, 'evaluate')
82+
self.assert_(result == False)
8283

8384

8485
expr.set_use_numexpr(False)

0 commit comments

Comments
 (0)