Skip to content

[BUG] missing functools.wraps makes debugging unawaited _needs_document_lock_wrapper methods difficult #11977

@graingert

Description

@graingert

Software versions

Python version : 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:03)
IPython version : 7.31.0
Tornado version : 6.1
Bokeh version : 2.4.2
BokehJS static path : /home/graingert/miniconda3/envs/dask-distributed/lib/python3.9/site-packages/bokeh/server/static
node.js version : (not installed)
npm version : (not installed)
Operating system : Linux-5.4.0-94-generic-x86_64-with-glibc2.31

Browser name and version

No response

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

>>> from unittest import mock
>>> from bokeh.server.session import ServerSession
>>> session = ServerSession(mock.MagicMock(), mock.MagicMock())
>>> coro = session.with_document_locked()
>>> del coro
<stdin>:1: RuntimeWarning: coroutine 'ServerSession.with_document_locked' was never awaited
>>> 

Observed behavior

>>> from unittest import mock
>>> from bokeh.server.session import ServerSession
>>> session = ServerSession(mock.MagicMock(), mock.MagicMock())
>>> coro = session.with_document_locked()
>>> del coro
<stdin>:1: RuntimeWarning: coroutine '_needs_document_lock.<locals>._needs_document_lock_wrapper' was never awaited
>>> 

Example code

see above

Stack traceback or browser console output

No response

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions