Skip to content

CI/TST: Check that unittest.mock is not being used in testing #24648

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

Merged
merged 1 commit into from
Jan 5, 2019

Conversation

simonjayhawkins
Copy link
Member

@jreback jreback added the CI Continuous Integration label Jan 5, 2019
@jreback jreback added this to the 0.24.0 milestone Jan 5, 2019
@jreback
Copy link
Contributor

jreback commented Jan 5, 2019

ping on green.

@codecov
Copy link

codecov bot commented Jan 5, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24648      +/-   ##
==========================================
- Coverage   92.37%   92.37%   -0.01%     
==========================================
  Files         166      166              
  Lines       52377    52380       +3     
==========================================
+ Hits        48385    48386       +1     
- Misses       3992     3994       +2
Flag Coverage Δ
#multiple 90.79% <ø> (-0.01%) ⬇️
#single 43.02% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/arrays/datetimes.py 97.68% <0%> (-0.16%) ⬇️
pandas/core/arrays/timedeltas.py 88.09% <0%> (-0.16%) ⬇️
pandas/core/arrays/period.py 98.52% <0%> (-0.02%) ⬇️
pandas/core/indexes/datetimelike.py 98.52% <0%> (ø) ⬆️

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 280a88f...2c59497. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jan 5, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24648      +/-   ##
==========================================
- Coverage   92.37%   92.37%   -0.01%     
==========================================
  Files         166      166              
  Lines       52377    52380       +3     
==========================================
+ Hits        48385    48386       +1     
- Misses       3992     3994       +2
Flag Coverage Δ
#multiple 90.79% <ø> (-0.01%) ⬇️
#single 43.02% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/arrays/datetimes.py 97.68% <0%> (-0.16%) ⬇️
pandas/core/arrays/timedeltas.py 88.09% <0%> (-0.16%) ⬇️
pandas/core/arrays/period.py 98.52% <0%> (-0.02%) ⬇️
pandas/core/indexes/datetimelike.py 98.52% <0%> (ø) ⬆️

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 280a88f...2c59497. Read the comment docs.

@jreback jreback merged commit 2ed7ade into pandas-dev:master Jan 5, 2019
@jreback
Copy link
Contributor

jreback commented Jan 5, 2019

thanks!

gfyoung added a commit that referenced this pull request Jan 6, 2019
@simonjayhawkins simonjayhawkins deleted the code-check branch January 6, 2019 09:39
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
@plammens
Copy link
Contributor

What was the rationale behind this? unittest.mock.Mock and unittest.mock.MagicMock are really useful (see this for example), and there's no equivalent with the monkeypatch fixture (which really only substitutes unittest.mock.patch, not the whole unittest.mock module).

If this was to avoid the import under Python 2, it's no longer relevant since Python 2 is no longer supported, and it should be reverted.

CC @simonjayhawkins, @jreback, @WillAyd

@jreback
Copy link
Contributor

jreback commented Sep 17, 2020

i think the description says it all

there is really no reason to use mock as monkey patch will do the limited things that we need

generally we prefer to not mock at all - when apis change often time mocks will work but the code is broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants