Raise a runtime error if run_async is called without real ContextVars

Werkzeug offers a ContextVar replacement for Python < 3.7, however it
doesn't work across asyncio tasks, hence it makes sense to error out
rather than find there are odd bugs.

Note the docs build requires the latest (dev) Werkzeug due to this
change (to import ContextVar from werkzeug.local).
This commit is contained in:
pgjones 2021-02-10 21:14:58 +00:00 committed by David Lord
parent c9f774d650
commit 47e0f2aab8
3 changed files with 19 additions and 1 deletions

View file

@ -25,5 +25,8 @@ skip_install = true
commands = pre-commit run --all-files --show-diff-on-failure
[testenv:docs]
deps = -r requirements/docs.txt
deps =
-r requirements/docs.txt
https://github.com/pallets/werkzeug/archive/master.tar.gz
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html