Skip to content

pytest deprecation warning #19703

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

Closed
TomAugspurger opened this issue Feb 14, 2018 · 4 comments · Fixed by #19987
Closed

pytest deprecation warning #19703

TomAugspurger opened this issue Feb 14, 2018 · 4 comments · Fixed by #19987
Labels
CI Continuous Integration Dependencies Required and optional dependencies good first issue Testing pandas testing functions or related to the test suite
Milestone

Comments

@TomAugspurger
Copy link
Contributor

home/travis/miniconda3/envs/pandas/lib/python3.6/site-packages/_pytest/mark.py:73: RemovedInPytest4Warning: Applying marks directly to parameters is deprecated, please use pytest.param(..., marks=...) instead.
For more details, see: https://docs.pytest.org/en/latest/parametrize.html
  warnings.warn(MARK_PARAMETERSET_UNPACKING)
$ ag "pytest.mark.*\(.*\)\("
pandas/tests/test_base.py
1220:    pytest.mark.xfail(reason='PeriodArray not implemented')((

though there are probably others.

@TomAugspurger TomAugspurger added Testing pandas testing functions or related to the test suite CI Continuous Integration Dependencies Required and optional dependencies good first issue labels Feb 14, 2018
@bhaveshpoddar94
Copy link
Contributor

Beginner Here. Can I look onto this?

@TomAugspurger
Copy link
Contributor Author

It looks like https://github.com/pandas-dev/pandas/pull/17253/files fixed most of these.

pytest.mark.xfail(reason='PeriodArray not implemented')((
may be the only one left.

You should change that to use something like

    pytest.param(pd.PeriodIndex(['2017', '2018'], freq='D'),
                 np.array([17167, 17532]),
                 marks=pytest.mark.xfail(reason="Not implemented")),

instead.

@bhaveshpoddar94
Copy link
Contributor

bhaveshpoddar94 commented Mar 3, 2018

So I just replaced the code on line 1227 with
pytest.param(pd.PeriodIndex(['2017', '2018'], freq='D'), np.array([17167, 17532]), marks=pytest.mark.xfail(reason="Not implemented")),

Is that correct?

@TomAugspurger
Copy link
Contributor Author

TomAugspurger commented Mar 4, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Dependencies Required and optional dependencies good first issue Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants