mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-14 13:33:00 +00:00
Remove 3.6 compatibility shims
- asyncio.all_tasks/current_task - pytest-asyncio 0.17 - contextmanager.nullcontext
This commit is contained in:
@@ -54,28 +54,6 @@ from .utils import add_user
|
||||
_db = None
|
||||
|
||||
|
||||
def _pytest_collection_modifyitems(items):
|
||||
"""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.
|
||||
|
||||
It is no longer required with pytest-asyncio >= 0.17
|
||||
"""
|
||||
for item in items:
|
||||
if inspect.iscoroutinefunction(item.obj):
|
||||
item.add_marker('asyncio')
|
||||
assert not inspect.isasyncgenfunction(item.obj)
|
||||
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
# apply pytest-asyncio's 'auto' mode on Python 3.6.
|
||||
# 'auto' mode is new in pytest-asyncio 0.17,
|
||||
# which requires Python 3.7.
|
||||
pytest_collection_modifyitems = _pytest_collection_modifyitems
|
||||
|
||||
|
||||
@fixture(scope='module')
|
||||
def ssl_tmpdir(tmpdir_factory):
|
||||
return tmpdir_factory.mktemp('ssl')
|
||||
|
Reference in New Issue
Block a user