question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected keyword argument 'path' from plugins

See original GitHub issue

While 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:closed
  • Created 3 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
RonnyPfannschmidtcommented, Mar 13, 2021

Sounds like I definitely should sort out the signature of the create call and issue a warning

1reaction
nicoddemuscommented, Mar 13, 2021

Hey @jaraco,

I’m making a quick guess as I don’t have time to delve deep into the code, but perhaps from_parent in pytest_checkdocs/__init__.py:52 needs to receive **kw and pass that on to super()?

cc @RonnyPfannschmidt

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found