Skip to content

MAINT: Remove pytest.warns in tests #19341

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 2 commits into from
Jan 22, 2018

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Jan 22, 2018

Per discussion in #18258, we are prohibiting its use in tests, at least for the time being.

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Code Style Code style, linting, code_checks labels Jan 22, 2018
@gfyoung
Copy link
Member Author

gfyoung commented Jan 22, 2018

I added the linting but will push fix in second commit once I confirm linting works.

@gfyoung gfyoung added this to the 0.23.0 milestone Jan 22, 2018
@jreback
Copy link
Contributor

jreback commented Jan 22, 2018

@gfyoung this needs to fix the test, no? ) (or maybe you are just testing if this will fail)

(pandas) bash-3.2$ grep -r -E --include '*.py' 'pytest\.warns' pandas/tests/
pandas/tests//series/test_timeseries.py:        with pytest.warns(FutureWarning):

@gfyoung
Copy link
Member Author

gfyoung commented Jan 22, 2018

(or maybe you are just testing if this will fail)

@jreback : Yes, that's the plan 😉 You can see that it worked.

https://travis-ci.org/pandas-dev/pandas/jobs/331740919#L3018

Per discussion in pandas-devgh-18258, we are
prohibiting its use in tests, at
least for the time being.
The lint correctly fails on this line.
@gfyoung gfyoung force-pushed the pytest-warns-remove branch from 499d330 to 09097c8 Compare January 22, 2018 17:08
@codecov
Copy link

codecov bot commented Jan 22, 2018

Codecov Report

Merging #19341 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #19341      +/-   ##
==========================================
- Coverage   91.57%   91.54%   -0.03%     
==========================================
  Files         150      150              
  Lines       48702    48702              
==========================================
- Hits        44597    44585      -12     
- Misses       4105     4117      +12
Flag Coverage Δ
#multiple 89.91% <ø> (-0.03%) ⬇️
#single 41.71% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/plotting/_converter.py 65.22% <0%> (-1.74%) ⬇️

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 2952fbd...09097c8. Read the comment docs.

@gfyoung
Copy link
Member Author

gfyoung commented Jan 22, 2018

@jreback : Lint error has been patched as planned. PTAL.

@jreback jreback merged commit d409eaf into pandas-dev:master Jan 22, 2018
@jreback
Copy link
Contributor

jreback commented Jan 23, 2018

thanks @gfyoung

I would not necessarily be averse to changing to use pytest.warns generally. I don't know if it has any diffs with what we have now.

@gfyoung gfyoung deleted the pytest-warns-remove branch January 23, 2018 07:15
@jorisvandenbossche
Copy link
Member

I would not necessarily be averse to changing to use pytest.warns generally. I don't know if it has any diffs with what we have now.

The main difference (I think) is that ours has check_stacklevel for deprecation/future warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants