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

'IPyNbCell' object has no attribute 'funcargs' #153

Open
ElephantsDad opened this issue Aug 6, 2020 · 3 comments
Open

'IPyNbCell' object has no attribute 'funcargs' #153

ElephantsDad opened this issue Aug 6, 2020 · 3 comments

Comments

@ElephantsDad
Copy link

ElephantsDad commented Aug 6, 2020

I'm trying to find the way to test all of my jupyterlab extensions in one notebook and I found that nbval could be usefull. But I can't even use it properly, because I'm having this error almost in every notebook (it occures even in documentation index.ipynb file from docs/source).

UPD: I forgot to tell that it happens in jupyterlab in docker container, seems like error doesn't show up outside it
For example:
Code in cell (I know this test should be failed because of random):

import numpy as np
print([np.random.rand() for i in range(4)])
print([np.random.rand() for i in range(4)])

Executing with:
py.test --nbval Untitled.ipynb

And got internal error:

Full error
platform linux -- Python 3.6.9, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
plugins: nbval-0.9.6, dash-1.1.1
collected 2 items                                                                                                                                                                                  

Untitled.ipynb 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/_pytest/main.py", line 240, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/_pytest/main.py", line 296, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/_pytest/main.py", line 321, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/_pytest/runner.py", line 100, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/_pytest/runner.py", line 117, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/_pytest/runner.py", line 209, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)  # type: TestReport
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/usr/local/lib/python3.6/dist-packages/dash/testing/plugin.py", line 65, in pytest_runtest_makereport
INTERNALERROR>     for name, fixture in item.funcargs.items():
INTERNALERROR> AttributeError: 'IPyNbCell' object has no attribute 'funcargs'

@vidartf
Copy link
Collaborator

vidartf commented Aug 11, 2020

I see you have a brand new version of pytest there (6.0.1). There might be some issues with that. Thanks for reporting!

@ElephantsDad
Copy link
Author

I see you have a brand new version of pytest there (6.0.1). There might be some issues with that. Thanks for reporting!

Oh, I didn't think about that. Can you please tell me, what version of pytest is compatible with current nbval version?

@takluyver
Copy link
Member

I suspect from the traceback that the pytest version is a red herring. I think nbval is clashing with another pytest plugin you have installed - dash/testing/plugin.py .

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

3 participants