mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
Retain an assertion and update comments
This commit is contained in:
@@ -930,7 +930,7 @@ class JupyterHub(Application):
|
|||||||
|
|
||||||
with an :meth:`authenticate` method that:
|
with an :meth:`authenticate` method that:
|
||||||
|
|
||||||
- is a coroutine (asyncio)
|
- is a coroutine (asyncio or tornado)
|
||||||
- returns username on success, None on failure
|
- returns username on success, None on failure
|
||||||
- takes two arguments: (handler, data),
|
- takes two arguments: (handler, data),
|
||||||
where `handler` is the calling web.RequestHandler,
|
where `handler` is the calling web.RequestHandler,
|
||||||
|
@@ -55,10 +55,16 @@ _db = None
|
|||||||
|
|
||||||
|
|
||||||
def pytest_collection_modifyitems(items):
|
def pytest_collection_modifyitems(items):
|
||||||
"""add asyncio marker to all async tests"""
|
"""This function is automatically run by pytest passing all collected test
|
||||||
|
functions.
|
||||||
|
|
||||||
|
We use it to add asyncio marker to all async tests and assert we don't use
|
||||||
|
test functions that are async generators which wouldn't make sense.
|
||||||
|
"""
|
||||||
for item in items:
|
for item in items:
|
||||||
if inspect.iscoroutinefunction(item.obj):
|
if inspect.iscoroutinefunction(item.obj):
|
||||||
item.add_marker('asyncio')
|
item.add_marker('asyncio')
|
||||||
|
assert not inspect.isasyncgenfunction(item.obj)
|
||||||
|
|
||||||
|
|
||||||
@fixture(scope='module')
|
@fixture(scope='module')
|
||||||
|
Reference in New Issue
Block a user