Skip to content

harmonize the testing namespace with tm.TestCase #8023

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
jankatins opened this issue Aug 14, 2014 · 4 comments
Closed

harmonize the testing namespace with tm.TestCase #8023

jankatins opened this issue Aug 14, 2014 · 4 comments
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@jankatins
Copy link
Contributor

Currently these two have different places to look for the relevant equality tests: TestCase has assert_numpy_array_equivalent and assert_numpy_array_equal but the testing module has assert_frame_equal and assert_series_equal.

It would be nice if all substantial code is available form the testing module and TestCase implements a small wrapper around these methods. That way someone outside pandas can import tm and us ethe methods without subclassing TestCase.

@jreback jreback added this to the 0.15.1 milestone Aug 14, 2014
@jreback
Copy link
Contributor

jreback commented Aug 14, 2014

yep, some of these are added, but the inherting from TestCase is pretty recent so the entire conversion hasn't been done yet. (converting the usage of tm.assert_series_equal to self.assert_series_equal for example)

@josef-pkt
Copy link

I haven't looked at this yet, I just started to look at the failing tests in statsmodels.

I don't think inheriting from TestCase makes sense for statsmodels. What we need is the equivalent of the numpy.testing assert_xxx functions.
For example, up to now we could use numpy.testing.assert_equal to compare anything. Now it fails with, for example, comparing two pandas index or dates. We will have to go through the failing test cases and find what the compatible version of assert_equal is.

@jankatins
Copy link
Contributor Author

@josef-pkt

import pandas.util.testing as tm
# for two series
tm.assert_series_equal(res, exp)
#for two frames
tm.assert_frame_equal(res, exp)

@jreback jreback modified the milestones: 0.15.2, 0.16.0 Nov 29, 2014
dxe4 added a commit to dxe4/pandas that referenced this issue Nov 30, 2014
TST: changed *args, **kwargs to fixed arguments. pandas-dev#8023

TST: Moved rest of the test functions to module level. pandas-dev#8023

TST: patch all module level assert functions to TestCase. pandas-dev#8023

CLN: Cleanup TestCase assert functions pathing pandas-dev#8023
jorisvandenbossche pushed a commit that referenced this issue Dec 1, 2014
TST: changed *args, **kwargs to fixed arguments. #8023

TST: Moved rest of the test functions to module level. #8023

TST: patch all module level assert functions to TestCase. #8023

CLN: Cleanup TestCase assert functions pathing #8023
@jorisvandenbossche
Copy link
Member

Closed by #8923

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.

4 participants