Skip to content

Adopt to pytest 7.x #61

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Adopt to pytest 7.x #61

wants to merge 1 commit into from

Conversation

wiget
Copy link

@wiget wiget commented Jul 29, 2022

pytest 7.x deprecated few things and also dropped support for python 2.7

This change also add testing on python 3.9 and 3.10, and run flake8 on
latest python in CI

pytest 7.x deprecated few things and also dropped support for python 2.7

This change also add testing on python 3.9 and 3.10, and run flake8 on
latest python in CI
@insertjokehere
Copy link

@kevincowan @paulka - Does Shopkeep intend to keep maintaining this plugin? It would be great if this and a couple of the other open PRs could be merged to ensure the plugin isn't broken by future updates

@kloczek
Copy link

kloczek commented Mar 9, 2024

I've been tryingto test this PR against pytest 8.1.0 and looks like it pytest fails

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-black-0.3.12-2.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-black-0.3.12-2.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network'
Traceback (most recent call last):
  File "/usr/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/usr/lib/python3.9/site-packages/_pytest/config/__init__.py", line 195, in console_main
    code = main()
  File "/usr/lib/python3.9/site-packages/_pytest/config/__init__.py", line 153, in main
    config = _prepareconfig(args, plugins)
  File "/usr/lib/python3.9/site-packages/_pytest/config/__init__.py", line 335, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/usr/lib/python3.9/site-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/usr/lib/python3.9/site-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3.9/site-packages/pluggy/_callers.py", line 138, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/usr/lib/python3.9/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
  File "/usr/lib/python3.9/site-packages/_pytest/helpconfig.py", line 105, in pytest_cmdline_parse
    config = yield
  File "/usr/lib/python3.9/site-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1141, in pytest_cmdline_parse
    self.parse(args)
  File "/usr/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1490, in parse
    self._preparse(args, addopts=addopts)
  File "/usr/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1377, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/usr/lib/python3.9/site-packages/pluggy/_manager.py", line 415, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/usr/lib/python3.9/site-packages/_pytest/config/__init__.py", line 497, in register
    plugin_name = super().register(plugin, name)
  File "/usr/lib/python3.9/site-packages/pluggy/_manager.py", line 167, in register
    self._verify_hook(hook, hookimpl)
  File "/usr/lib/python3.9/site-packages/pluggy/_manager.py", line 342, in _verify_hook
    raise PluginValidationError(
pluggy._manager.PluginValidationError: Plugin 'black' for hook 'pytest_collect_file'
hookimpl definition: pytest_collect_file(file_path, path, parent)
Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec

@wiget
Copy link
Author

wiget commented Mar 15, 2024

Cześć @kloczek

pytest 8.1.0 version was broken and it's yanked. Please use 8.1.1

PS: Nice to meet you again after long years.

@kloczek
Copy link

kloczek commented Mar 16, 2024

Yep with 8.1.1 everything is OK.

jaraco added a commit to coherent-oss/pytest-black that referenced this pull request Dec 15, 2024
Adds support for Pytest 7.
@jaraco
Copy link
Contributor

jaraco commented Dec 15, 2024

This has been merged into coherent-oss/pytest-black and released as v0.5.0.

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

Successfully merging this pull request may close these issues.

4 participants