Skip to content

TST: slow computation/test_eval.py tests need adjustment #13338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jreback opened this issue May 31, 2016 · 1 comment
Closed

TST: slow computation/test_eval.py tests need adjustment #13338

jreback opened this issue May 31, 2016 · 1 comment
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented May 31, 2016

https://travis-ci.org/pydata/pandas/jobs/134204278

I think #13311 broke some of these

here's some partial fixes

diff --git a/pandas/computation/tests/test_eval.py b/pandas/computation/tests/test_eval.py
index 4dc1e24..69b8830 100644
--- a/pandas/computation/tests/test_eval.py
+++ b/pandas/computation/tests/test_eval.py
@@ -248,7 +248,7 @@ class TestEvalNumexprPandas(tm.TestCase):
             for ex in (ex1, ex2, ex3):
                 result = pd.eval(ex, engine=self.engine,
                                  parser=self.parser)
-                tm.assert_numpy_array_equal(result, expected)
+                tm.assert_almost_equal(result, expected)

     def check_simple_cmp_op(self, lhs, cmp1, rhs):
         ex = 'lhs {0} rhs'.format(cmp1)
@@ -265,7 +265,8 @@ class TestEvalNumexprPandas(tm.TestCase):
         ex = 'lhs {0} rhs'.format(arith1)
         result = pd.eval(ex, engine=self.engine, parser=self.parser)
         expected = _eval_single_bin(lhs, arith1, rhs, self.engine)
-        tm.assert_numpy_array_equal(result, expected)
+
+        tm.assert_almost_equal(result, expected)
         ex = 'lhs {0} rhs {0} rhs'.format(arith1)
         result = pd.eval(ex, engine=self.engine, parser=self.parser)
         nlhs = _eval_single_bin(lhs, arith1, rhs,
@@ -280,8 +281,10 @@ class TestEvalNumexprPandas(tm.TestCase):
             # TypeError, AttributeError: series or frame with scalar align
             pass
         else:
+
+            # direct numpy comparison
             expected = self.ne.evaluate('nlhs {0} ghs'.format(op))
-            tm.assert_numpy_array_equal(result, expected)
+            tm.assert_numpy_array_equal(result.values, expected)

     # modulus, pow, and floor division require special casing
@jreback jreback added the Testing pandas testing functions or related to the test suite label May 31, 2016
@jreback jreback added this to the 0.18.2 milestone May 31, 2016
@jreback
Copy link
Contributor Author

jreback commented May 31, 2016

cc @sinhrks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant