-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix tests #108
Fix tests #108
Conversation
This was being used for compatibility with py3.5 but we are not supporting this anymore so we can rely on the build-in support for async yields and test-asyncio for fixtures.
I thought this may have to do with the fact that a kernel is not installed. By installing one with with open(my_dir / pathlib.Path('notebooks/communicator.ipynb')) as handle:
> fixture.check(handle)
test/rmq/test_rmq_thread_communicator.py:269:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/sph/.virtualenvs/aiida_dev/lib/python3.9/site-packages/pytest_notebook/execution.py:262: in execute_notebook
proc.preprocess(new_notebook, resources)
/home/sph/.virtualenvs/aiida_dev/lib/python3.9/site-packages/pytest_notebook/execution.py:159: in preprocess
nb, resources = super(ExecutePreprocessor, self).preprocess(
/home/sph/.virtualenvs/aiida_dev/lib/python3.9/site-packages/nbconvert/preprocessors/base.py:69: in preprocess
nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
/home/sph/.virtualenvs/aiida_dev/lib/python3.9/site-packages/pytest_notebook/execution.py:175: in preprocess_cell
return super().preprocess_cell(cell, resources, cell_index)
/home/sph/.virtualenvs/aiida_dev/lib/python3.9/site-packages/nbconvert/preprocessors/execute.py:438: in preprocess_cell
reply, outputs = self.run_cell(cell, cell_index, store_history)
/home/sph/.virtualenvs/aiida_dev/lib/python3.9/site-packages/nbconvert/preprocessors/execute.py:578: in run_cell
exec_reply = self._poll_for_reply(parent_msg_id, cell, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_notebook.execution.ExecuteCoveragePreprocessor object at 0x7f7e4d40e9a0>, msg_id = '3b785650-759ab2172974b2accbec6521_76727_1'
cell = {'cell_type': 'code', 'execution_count': 1, 'metadata': {'pycharm': {'name': '#%%\n'}}, 'outputs': [], 'source': 'impo...turn "Thanks!"\n\n\ncomm.add_rpc_subscriber(rpc_call, \'tester\')\n\nresponse = comm.rpc_send(\'tester\', \'hello!\')'}
timeout = 1
def _poll_for_reply(self, msg_id, cell=None, timeout=None):
try:
# check with timeout if kernel is still alive
msg = self.kc.shell_channel.get_msg(timeout=timeout)
> if msg['parent_header'].get('msg_id') == msg_id:
E TypeError: 'coroutine' object is not subscriptable This seems to come from @chrisjsewell 's |
See chrisjsewell/pytest-notebook#17, I'll try and whip up a fix today |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #108 +/- ##
========================================
Coverage 90.34% 90.34%
========================================
Files 16 16
Lines 1138 1138
========================================
Hits 1028 1028
Misses 110 110 ☔ View full report in Codecov by Sentry. |
Ok all fixed:
|
Indeed, had already encountered this with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @muhrin and @chrisjsewell
Fixed tests by removing async_generator
This was being used for compatibility with py3.5 but we are not
supporting this anymore so we can rely on the build-in support for async
yields and test-asyncio for fixtures.
@chrisjsewell do you understand why the out jupyter notebook test fails? I don't understand the error message at all...