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

TST: remove patches to pandas.util.testing.N #24826

Merged
merged 2 commits into from
Jan 18, 2019

Conversation

simonjayhawkins
Copy link
Member

@jorisvandenbossche
Copy link
Member

Another solution might be to add this as a keyword argument to those functions, so the monkeypatch is not needed?

@codecov
Copy link

codecov bot commented Jan 18, 2019

Codecov Report

Merging #24826 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24826   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files         166      166           
  Lines       52379    52379           
=======================================
  Hits        48392    48392           
  Misses       3987     3987
Flag Coverage Δ
#multiple 90.81% <ø> (ø) ⬆️
#single 42.91% <ø> (ø) ⬆️

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 512830b...6b5b392. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 18, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24826      +/-   ##
==========================================
- Coverage   92.38%   92.38%   -0.01%     
==========================================
  Files         166      166              
  Lines       52379    52379              
==========================================
- Hits        48392    48391       -1     
- Misses       3987     3988       +1
Flag Coverage Δ
#multiple 90.81% <ø> (ø) ⬆️
#single 42.91% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/util/testing.py 88.04% <0%> (-0.1%) ⬇️

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 512830b...be9ff97. Read the comment docs.

@simonjayhawkins
Copy link
Member Author

@jorisvandenbossche

so the monkeypatch is not needed?

are you not a fan of monkeypatch?

there are only 4 instances where the patch is needed, one of those is for depecated Panel another instance is code duplication resulting from some tests using unittest setup method and other tests having the setup method converted to pytest fixtures.

the monkeypatch used as context manager is to make it more explicit what is happening and ensuring that the patch in the fixture is undone before the test executes. this may appear to add additional lines of code.

my only concern with altering pandas.util.testing is that it is in the pandas directory and not the tests directory, so a change here would be considered an api change?

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.

see my comments; all of the examples should not need patching

"""DataFrame with 3 level MultiIndex (year, month, day) covering
first 100 business days from 2000-01-01 with random data"""
tm.N = 100
tdf = tm.makeTimeDataFrame()
with monkeypatch.context() as m:
Copy link
Contributor

Choose a reason for hiding this comment

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

why do all this, makeTimeDataFrame(100) will do this

@jreback jreback added the Testing pandas testing functions or related to the test suite label Jan 18, 2019
@simonjayhawkins simonjayhawkins changed the title TST: patch changes to pandas.util.testing TST: remove patches to pandas.util.testing.N Jan 18, 2019
@jreback jreback added this to the 0.24.0 milestone Jan 18, 2019
@jreback
Copy link
Contributor

jreback commented Jan 18, 2019

looks ok, ping on green.

@simonjayhawkins
Copy link
Member Author

@jreback green!

@WillAyd WillAyd merged commit ccde0a8 into pandas-dev:master Jan 18, 2019
@WillAyd
Copy link
Member

WillAyd commented Jan 18, 2019

Thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the patch-tm branch January 18, 2019 22:16
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
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.

None yet

4 participants