Unexpected keyword argument 'path' from plugins
See original GitHub issueWhile troubleshooting #8332, I stumbled onto a new error, a TypeError
that occurs when using pytest-black against the current main HEAD (32ad70d), easily reproducible with an empty test file and pip-run:
draft $ touch test_something.py
draft $ pip-run -q git+https://github.com/pytest-dev/pytest pytest-black -- -m pytest --black
===================================================================================== test session starts =====================================================================================
platform darwin -- Python 3.9.2, pytest-6.3.0.dev252+g32ad70dea, py-1.10.0, pluggy-0.13.1
rootdir: /Users/jaraco/draft
plugins: black-0.3.12
collected 0 items / 1 error
=========================================================================================== ERRORS ============================================================================================
________________________________________________________________________________ ERROR collecting test session ________________________________________________________________________________
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-j9xn8e36/pluggy/hooks.py:286: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-j9xn8e36/pluggy/manager.py:93: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-j9xn8e36/pluggy/manager.py:84: in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-j9xn8e36/pytest_black.py:27: in pytest_collect_file
return BlackItem.from_parent(parent, fspath=path)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-j9xn8e36/_pytest/nodes.py:578: in from_parent
return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-j9xn8e36/_pytest/nodes.py:226: in from_parent
return cls._create(parent=parent, **kw)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-j9xn8e36/_pytest/nodes.py:117: in _create
return super().__call__(*k, **kw)
E TypeError: __init__() got an unexpected keyword argument 'path'
=================================================================================== short test summary info ===================================================================================
ERROR - TypeError: __init__() got an unexpected keyword argument 'path'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================================== 1 error in 0.13s =======================================================================================
Same problem happens with pytest-checkdocs:
draft $ touch setup.py
draft $ pip-run -q git+https://github.com/pytest-dev/pytest pytest-checkdocs -- -m pytest
===================================================================================== test session starts =====================================================================================
platform darwin -- Python 3.9.2, pytest-6.3.0.dev252+g32ad70dea, py-1.10.0, pluggy-0.13.1
rootdir: /Users/jaraco/draft
plugins: checkdocs-2.4.0
collected 0 items / 1 error
=========================================================================================== ERRORS ============================================================================================
________________________________________________________________________________ ERROR collecting test session ________________________________________________________________________________
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/pluggy/hooks.py:286: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/pluggy/manager.py:93: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/pluggy/manager.py:84: in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/pytest_checkdocs/__init__.py:14: in pytest_collect_file
CheckdocsItem.from_parent(parent, fspath=path)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/pytest_checkdocs/__init__.py:52: in from_parent
return super().from_parent(parent, fspath=fspath)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/_pytest/nodes.py:578: in from_parent
return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/_pytest/nodes.py:226: in from_parent
return cls._create(parent=parent, **kw)
/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-5hc5__bb/_pytest/nodes.py:117: in _create
return super().__call__(*k, **kw)
E TypeError: __init__() got an unexpected keyword argument 'path'
=================================================================================== short test summary info ===================================================================================
ERROR - TypeError: __init__() got an unexpected keyword argument 'path'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================================== 1 error in 0.20s =======================================================================================
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Flask Catch-All Error - unexpected keyword argument 'path'
I forgot to add path as a parameter in my function: def api(path) @app.route('/api/v1/<path:path>') def api(path): <--- return 'You want ...
Read more >I can't install/uninstall a plugin, I get something about an ...
I can't install/uninstall a plugin, I get something about an "unexpected keyword argument 'async'" · Log into your OctoPrint server via SSH or ......
Read more >errbotio/errbot - Gitter
I have a plugin that is using @botcmd and @arg_botcmd. function that takes 6 arguments. I have a 3rd argument @arg_botcmd("--git-email", dest="git_email", ...
Read more >TypeError: __init__() got an unexpected keyword argument ...
Hi, I have followed the steps given in the chapter to set up mflix app. After completing all the procedure, the following error...
Read more >Answers Developer Questions | Atlassian Community
Error TypeError: request() got an unexpected keyword argument 'json' ... I'm trying to run through the tutorials for plugins, and I'm having trouble...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sounds like I definitely should sort out the signature of the create call and issue a warning
Hey @jaraco,
I’m making a quick guess as I don’t have time to delve deep into the code, but perhaps
from_parent
inpytest_checkdocs/__init__.py:52
needs to receive**kw
and pass that on tosuper()
?cc @RonnyPfannschmidt