Skip to content

pandas.test() produces many PytestUnknownMarkWarning #32760

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 Mar 16, 2020 · 4 comments
Closed

pandas.test() produces many PytestUnknownMarkWarning #32760

TomAugspurger opened this issue Mar 16, 2020 · 4 comments
Labels
Build Library building on various platforms Enhancement Testing pandas testing functions or related to the test suite Warnings Warnings that appear or should be added to pandas

Comments

@TomAugspurger
Copy link
Contributor

For example

>>> import pandas
>>> pandas.test(['-k', 'TestPDApi'])

Has many warnings like

Envs/dask-dev/lib/python3.7/site-packages/pandas/tests/series/indexing/test_datetime.py:121
  /Users/taugspurger/Envs/dask-dev/lib/python3.7/site-packages/pandas/tests/series/indexing/test_datetime.py:121: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.slow

Envs/dask-dev/lib/python3.7/site-packages/pandas/tests/series/methods/test_rank.py:559
  /Users/taugspurger/Envs/dask-dev/lib/python3.7/site-packages/pandas/tests/series/methods/test_rank.py:559: PytestUnknownMarkWarning: Unknown pytest.mark.single - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.single

Envs/dask-dev/lib/python3.7/site-packages/pandas/tests/series/methods/test_rank.py:560
  /Users/taugspurger/Envs/dask-dev/lib/python3.7/site-packages/pandas/tests/series/methods/test_rank.py:560: PytestUnknownMarkWarning: Unknown pytest.mark.high_memory - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.high_memory

We register these:

pandas/setup.cfg

Lines 56 to 62 in 5da500a

markers =
single: mark a test as single cpu only
slow: mark a test as slow
network: mark a test as network
db: tests requiring a database (mysql or postgres)
high_memory: mark a test as a high-memory only
clipboard: mark a pd.read_clipboard test
. But the setup.cfg is perhaps not included with the distribution, and so the registered marks aren't available perhaps? Is there anyone more familiar with pytest who knows what we should be doing here?

@TomAugspurger TomAugspurger added the Testing pandas testing functions or related to the test suite label Mar 16, 2020
@TomAugspurger TomAugspurger added this to the Contributions Welcome milestone Mar 16, 2020
@WillAyd
Copy link
Member

WillAyd commented Mar 16, 2020

Hmm this might be important for mypy as well as all of our config is contained in that file. Maybe we should just distribute that with the package?

@TomAugspurger
Copy link
Contributor Author

I'm not sure that distributing the setup.cfg is an option. It's not clear where it would be placed (it's not in the pandas package source directory), and I don't know how we would get pytest to read it. It seems like if we want users to have these marks, we'd need to treat them like a custom plugin: https://docs.pytest.org/en/latest/writing_plugins.html#registering-custom-markers

@mroeschke mroeschke added Warnings Warnings that appear or should be added to pandas Enhancement Build Library building on various platforms labels May 22, 2020
@jbrockmendel
Copy link
Member

Just tried this and I don't see the warnings from the OP, do see

========================================================================== warnings summary ==========================================================================
/usr/local/lib/python3.8/site-packages/_pytest/config/__init__.py:1040
  /usr/local/lib/python3.8/site-packages/_pytest/config/__init__.py:1040: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: hypothesis
    self._mark_plugins_for_rewrite(hook)

/usr/local/lib/python3.8/site-packages/aiohttp/helpers.py:107
  /usr/local/lib/python3.8/site-packages/aiohttp/helpers.py:107: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def noop(*args, **kwargs):  # type: ignore

-- Docs: https://docs.pytest.org/en/stable/warnings.html
==================================================== 2 passed, 2 skipped, 74034 deselected, 2 warnings in 36.24s =====================================================

@TomAugspurger
Copy link
Contributor Author

This was fixed in #35146, sorry.

Those other workings are from other packages, so likely nothing we can do about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Enhancement Testing pandas testing functions or related to the test suite Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

No branches or pull requests

4 participants