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 self.assertEqual from testing #16169

Merged
merged 1 commit into from
Apr 29, 2017

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Apr 29, 2017

Title is self-explanatory. Massive, massive PR.

Partially addresses #15990.

@codecov
Copy link

codecov bot commented Apr 29, 2017

Codecov Report

Merging #16169 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16169      +/-   ##
==========================================
- Coverage   90.86%   90.86%   -0.01%     
==========================================
  Files         162      162              
  Lines       50819    50821       +2     
==========================================
  Hits        46177    46177              
- Misses       4642     4644       +2
Flag Coverage Δ
#multiple 88.64% <50%> (-0.01%) ⬇️
#single 40.33% <50%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/compat/__init__.py 62.22% <50%> (-0.11%) ⬇️
pandas/core/common.py 90.68% <0%> (-0.35%) ⬇️

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 a7a0574...1c69060. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 29, 2017

Codecov Report

Merging #16169 into master will increase coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16169      +/-   ##
==========================================
+ Coverage   90.86%   90.88%   +0.02%     
==========================================
  Files         162      162              
  Lines       50819    50821       +2     
==========================================
+ Hits        46177    46190      +13     
+ Misses       4642     4631      -11
Flag Coverage Δ
#multiple 88.67% <50%> (+0.02%) ⬆️
#single 40.33% <50%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/compat/__init__.py 62.22% <50%> (-0.11%) ⬇️
pandas/plotting/_converter.py 65.35% <0%> (+1.81%) ⬆️

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 a7a0574...9fb41da. Read the comment docs.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple of places where I actually want to assert that i am getting a boolean back

use assert is False

assert is_scalar(result)

x = False
result = pd.eval('x', engine=self.engine, parser=self.parser)
self.assertEqual(result, False)
assert not result
assert is_scalar(result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert result is False

if the test is actually expecting False and not just Falsey

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


# Check non-masked values
mat2 = ma.copy(mat)
mat2[0, 0] = True
mat2[1, 2] = False
frame = DataFrame(mat2, columns=['A', 'B', 'C'], index=[1, 2])
self.assertEqual(True, frame['A'][1])
self.assertEqual(False, frame['C'][2])
assert frame['A'][1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is True and is False

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@gfyoung
Copy link
Member Author

gfyoung commented Apr 29, 2017

Travis is failing for reasons that I don't understand....see here.

@jreback
Copy link
Contributor

jreback commented Apr 29, 2017

do those work locally?

you can just revert that module/file for now and debug / followup after .

@jreback jreback added the Testing pandas testing functions or related to the test suite label Apr 29, 2017
@gfyoung
Copy link
Member Author

gfyoung commented Apr 29, 2017

@jreback : Yes, they do. I walked through the code myself. Also, the AssertionError message makes no sense. It says that False is False is not right. That is absolutely correct.

@gfyoung
Copy link
Member Author

gfyoung commented Apr 29, 2017

@jreback : You know what I can do: I can check type (i.e. assert is_bool(x)) and see if that works

@gfyoung
Copy link
Member Author

gfyoung commented Apr 29, 2017

@jreback : Workaround succeeded. Everything is green.

@@ -104,6 +104,7 @@ def signature(f):
map = map
zip = zip
filter = filter
intern = sys.intern
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine
but where is it used?

Copy link
Member Author

@gfyoung gfyoung Apr 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stumbled upon it in a test (test_util.py), so I added this to compat for that reason.

@jreback jreback merged commit 5bc736c into pandas-dev:master Apr 29, 2017
@jreback
Copy link
Contributor

jreback commented Apr 29, 2017

thanks!

@gfyoung gfyoung deleted the assert-equal-remove branch April 29, 2017 20:23
cbertinato pushed a commit to cbertinato/pandas that referenced this pull request May 1, 2017
pcluo pushed a commit to pcluo/pandas that referenced this pull request May 22, 2017
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