diff --git a/jupyterhub/app.py b/jupyterhub/app.py index af394990..676198a6 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -930,7 +930,7 @@ class JupyterHub(Application): with an :meth:`authenticate` method that: - - is a coroutine (asyncio) + - is a coroutine (asyncio or tornado) - returns username on success, None on failure - takes two arguments: (handler, data), where `handler` is the calling web.RequestHandler, diff --git a/jupyterhub/tests/conftest.py b/jupyterhub/tests/conftest.py index c4c08b90..34c94e4f 100644 --- a/jupyterhub/tests/conftest.py +++ b/jupyterhub/tests/conftest.py @@ -55,10 +55,16 @@ _db = None 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: if inspect.iscoroutinefunction(item.obj): item.add_marker('asyncio') + assert not inspect.isasyncgenfunction(item.obj) @fixture(scope='module')