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

Unit tests locally failing with 'DeprecationWarning: The --rsyncdir command...' #3805

Open
tadeja opened this issue Jul 22, 2023 · 1 comment

Comments

@tadeja
Copy link

tadeja commented Jul 22, 2023

The same error as reported before in closed #3357 still happens when running unit tests locally now with
pytest-cov==4.1.0
pytest-xdist==3.3.1

To Reproduce
Run unit tests

(.venv) % tox -e py
...
...
Successfully built black
Installing collected packages: typing-extensions, pathspec, mypy-extensions, multidict, idna, frozenlist, click, charset-normalizer, attrs, async-timeout, yarl, black, aiosignal, aiohttp
Successfully installed aiohttp-3.8.5 aiosignal-1.3.1 async-timeout-4.0.2 attrs-23.1.0 black-23.7.1.dev13+g0b301f8.d20230722 charset-normalizer-3.2.0 click-8.1.6 frozenlist-1.4.0 idna-3.4 multidict-6.0.4 mypy-extensions-1.0.0 pathspec-0.11.1 typing-extensions-4.7.1 yarl-1.9.2
py: commands[1]> coverage erase
py: commands[2]> pytest tests --run-optional no_jupyter --numprocesses auto --cov
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1054, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/pluggy/_hooks.py", line 452, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self._hookimpls, kwargs, False)
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/pluggy/_manager.py", line 112, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/pluggy/_callers.py", line 116, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/pluggy/_callers.py", line 80, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/xdist/plugin.py", line 252, in pytest_configure
INTERNALERROR>     config.issue_config_time_warning(warning, 2)
INTERNALERROR>   File "/Users/user/Documents/black/.tox/py/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1465, in issue_config_time_warning
INTERNALERROR>     warnings.warn(warning, stacklevel=stacklevel)
INTERNALERROR> DeprecationWarning: The --rsyncdir command line argument and rsyncdirs config variable are deprecated.
INTERNALERROR> The rsync feature will be removed in pytest-xdist 4.0.
py: exit 3 (0.50 seconds) /Users/user/Documents/black> pytest tests --run-optional no_jupyter --numprocesses auto --cov pid=48636
  py: FAIL code 3 (9.34=setup[4.63]+cmd[3.73,0.49,0.50] seconds)
  evaluation failed :( (9.39 seconds)

Environment
Black's version: main
OS and Python version: macOS/Python 3.11.4 and Python 3.9.6

Additional context
A temporary work-around as suggested here pytest-dev/pytest-xdist#825 (comment)
could be to add the filter to pyproject.toml:

filterwarnings = [
    "error",
...,
    '''ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning'''
]

Also: Fixed by not running PyPy with coverage
Originally posted by @hauntsaninja in #3772 (comment)

@jnhyperion
Copy link
Contributor

same error, try this tox -e ci-py39 -- -v --color=yes run against a certain python version.

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

No branches or pull requests

2 participants