Retain an assertion and update comments

This commit is contained in:
Erik Sundell
2020-11-11 15:40:54 +01:00
parent fca2528332
commit d581cf54cb
2 changed files with 8 additions and 2 deletions

View File

@@ -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,

View File

@@ -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')