Skip to content
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

MAINT: Remove vestigial self.assert* #16190

Merged
merged 1 commit into from
May 2, 2017

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented May 2, 2017

Remove all remaining self.assert* method calls originating from unittest. Any that are left are calls to methods directly defined in the test class or a higher derived pandas test class.

Partially addresses #15990.

Once this PR is merged, it is important that we remain vigilant about requiring PR's to adhere to the pytest idiom until we remove our dependency on unittest.TestCase (after which the builds will do the work when tests fail).

Remove all remaining self.assert*
method calls originating from unittest.
Any that are left are calls to methods
directly defined in the test class or
a higher derived pandas test class.
@gfyoung
Copy link
Member Author

gfyoung commented May 2, 2017

After this PR, all uses of the unittest.TestCase methods will have been removed. The question remains on how to best remove the dependency. Initially, I was thinking that we should remove tm.TestCase entirely, but I see that the setUpClass method has a useful property setting call for chained assignment. Several classes also call the setup and teardown methods here as part of their implementations.

Thus, I am inclined to leave tm.TestCase alone and just rename the setup and teardown functions according to pytest idiom (see here) and just have tm.TestCase inherit from object instead of unittest.TestCase. Thoughts?

@jreback
Copy link
Contributor

jreback commented May 2, 2017

is it worthwhile to add NotImplementedError to TestCase for the unittest functions (temporarily)?

@gfyoung
Copy link
Member Author

gfyoung commented May 2, 2017

It's not public API, so I don't see why we should? The only people who will be "surprised" should be any developers on this library I would think.

@jreback
Copy link
Contributor

jreback commented May 2, 2017

not sure what u mean

this is a simple way of preventing unittest idioms from slipping back in (until TestCase is fixed)

@gfyoung
Copy link
Member Author

gfyoung commented May 2, 2017

Well, I'm going to fix it as soon as this PR is merged, so that should be moot? 😄

@codecov
Copy link

codecov bot commented May 2, 2017

Codecov Report

Merging #16190 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16190      +/-   ##
==========================================
+ Coverage   90.86%   90.86%   +<.01%     
==========================================
  Files         162      162              
  Lines       50862    50862              
==========================================
+ Hits        46215    46216       +1     
+ Misses       4647     4646       -1
Flag Coverage Δ
#multiple 88.64% <ø> (ø) ⬆️
#single 40.3% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/common.py 91.03% <0%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 217864e...f52df83. Read the comment docs.

@gfyoung
Copy link
Member Author

gfyoung commented May 2, 2017

@jreback : Everything is green and ready to merge.

@jreback jreback added the Testing pandas testing functions or related to the test suite label May 2, 2017
@jreback jreback added this to the 0.20.0 milestone May 2, 2017
@jreback jreback merged commit e19a0ff into pandas-dev:master May 2, 2017
@jreback
Copy link
Contributor

jreback commented May 2, 2017

thanks!

@gfyoung gfyoung deleted the self-assert-remove branch May 2, 2017 13:29
pcluo pushed a commit to pcluo/pandas that referenced this pull request May 22, 2017
Remove all remaining self.assert*
method calls originating from unittest.
Any that are left are calls to methods
directly defined in the test class or
a higher derived pandas test class.
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 this pull request may close these issues.

2 participants