Skip to content

TST: computation/tests/test_eval.py #6069

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
dsm054 opened this issue Jan 24, 2014 · 6 comments
Closed

TST: computation/tests/test_eval.py #6069

dsm054 opened this issue Jan 24, 2014 · 6 comments
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@dsm054
Copy link
Contributor

dsm054 commented Jan 24, 2014

There are two strange things in computation/tests/test_eval.py.

First, in check_complex_cmp_op:

    elif _bool_and_frame(lhs, rhs):
        self.assertRaises(TypeError, _eval_single_bin, lhs_new, '&',
                          rhs_new, self.engine)
        self.assertRaises(TypeError, pd.eval, ex,
                          local_dict={'lhs': lhs, 'rhs': rhs},
                          engine=self.engine, parser=self.parser)

neither lhs_new nor rhs_new are defined (they're defined later on another branch). Probably they're meant to be simply lhs and rhs.

Second, in the subfunction check_operands:

                with assertRaises(NotImplementedError):
                    pd.eval(ex, engine=self.engine, parser=self.parser)

assertRaises isn't defined. This should probably be tm.assertRaises, as in the previous

            with tm.assertRaises(ValueError):
                pd.eval(ex, engine=self.engine, parser=self.parser)

I guess neither of these code paths are being exercised at the moment, which is why it hasn't been an issue.

@jreback
Copy link
Contributor

jreback commented Jan 24, 2014

how do u find these!

@dsm054
Copy link
Contributor Author

dsm054 commented Jan 24, 2014

@jreback: I'd like to claim it was mad hax0r skillz, but really I just ran cython filename.py. Even when I'm not going to use the cythonized version it's handy to pick up certain classes of errors.

@jreback
Copy link
Contributor

jreback commented Jan 24, 2014

oh....interesting....thanks......pls sbumit a PR if you'd lke to fix

@dsm054
Copy link
Contributor Author

dsm054 commented Jan 24, 2014

@jreback: that'd be easy, but is it alright to leave them unexecuted?

@cpcloud
Copy link
Member

cpcloud commented Jan 24, 2014

@dsm054 That is a useful technique. When I wrote these I got a bit overwhelmed with trying to cover all the possible test cases without being repetitive. Looks like I was only partially successful at either 😦

@dsm054
Copy link
Contributor Author

dsm054 commented Jan 30, 2014

This was closed via #6074.

@dsm054 dsm054 closed this as completed Jan 30, 2014
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

No branches or pull requests

3 participants