$ tox -e py311
py311: install_deps> python -I -m pip install flask pytest
.pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel
.pkg: _optional_hooks> python /usr/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_sdist> python /usr/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: install_requires_for_build_sdist> python -I -m pip install setuptools_scm
.pkg: prepare_metadata_for_build_wheel> python /usr/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_sdist> python /usr/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py311: install_package> python -I -m pip install --force-reinstall --no-deps /tmp/picobox/.tox/.tmp/package/1/picobox-2.2.1.dev34+ge92b001.tar.gz
py311: commands[0]> .tox/py311/bin/python -m pytest --strict
========================================================= test session starts =========================================================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0
cachedir: .tox/py311/.pytest_cache
rootdir: /tmp/picobox
collected 1266 items
tests/test_box.py ............................................................................................................. [ 8%]
............................................................................................................... [ 17%]
tests/test_scopes.py s......................................................................................................... [ 25%]
............................................................................................................................... [ 35%]
...............................................................................................................F.F...F..F..F..F [ 45%]
..F..F...F. [ 46%]
tests/test_stack.py ........................................................................................................... [ 55%]
............................................................................................................................... [ 65%]
............................................................................................................................... [ 75%]
............................................................................................................................... [ 85%]
.......... [ 86%]
tests/contrib/test_flaskscopes.py ............................................................................................. [ 93%]
.................................................................................... [100%]
============================================================== FAILURES ===============================================================
__________________________________________ test_scope_value_shared[singleton-exec_coroutine] __________________________________________
request = <FixtureRequest for <Function test_scope_value_shared[singleton-exec_coroutine]>>, scopename = 'singleton'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("singleton", "exec_thread"),
("singleton", "exec_coroutine"),
("singleton", "exec_context"),
("threadlocal", "exec_coroutine"),
("threadlocal", "exec_context"),
],
)
def test_scope_value_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
> exec_(scope.set, "the-key", value)
tests/test_scopes.py:195:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <bound method singleton.set of <picobox._scopes.singleton object at 0x7fe02d2cdf90>>
args = ('the-key', <object object at 0x7fe02e2b18f0>), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
_________________________________________ test_scope_value_shared[threadlocal-exec_coroutine] _________________________________________
request = <FixtureRequest for <Function test_scope_value_shared[threadlocal-exec_coroutine]>>, scopename = 'threadlocal'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("singleton", "exec_thread"),
("singleton", "exec_coroutine"),
("singleton", "exec_context"),
("threadlocal", "exec_coroutine"),
("threadlocal", "exec_context"),
],
)
def test_scope_value_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
> exec_(scope.set, "the-key", value)
tests/test_scopes.py:195:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <bound method threadlocal.set of <picobox._scopes.threadlocal object at 0x7fe02c9eb4d0>>
args = ('the-key', <object object at 0x7fe02e2b29a0>), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
_______________________________________ test_scope_value_not_shared[contextvars-exec_coroutine] _______________________________________
request = <FixtureRequest for <Function test_scope_value_not_shared[contextvars-exec_coroutine]>>, scopename = 'contextvars'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("threadlocal", "exec_thread"),
("contextvars", "exec_thread"),
("contextvars", "exec_coroutine"),
("contextvars", "exec_context"),
("noscope", "exec_thread"),
("noscope", "exec_coroutine"),
("noscope", "exec_context"),
],
)
def test_scope_value_not_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
> exec_(scope.set, "the-key", value)
tests/test_scopes.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <bound method contextvars.set of <picobox._scopes.contextvars object at 0x7fe02ca3cf90>>
args = ('the-key', <object object at 0x7fe02e2b2200>), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
_________________________________________ test_scope_value_not_shared[noscope-exec_coroutine] _________________________________________
request = <FixtureRequest for <Function test_scope_value_not_shared[noscope-exec_coroutine]>>, scopename = 'noscope'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("threadlocal", "exec_thread"),
("contextvars", "exec_thread"),
("contextvars", "exec_coroutine"),
("contextvars", "exec_context"),
("noscope", "exec_thread"),
("noscope", "exec_coroutine"),
("noscope", "exec_context"),
],
)
def test_scope_value_not_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
> exec_(scope.set, "the-key", value)
tests/test_scopes.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <bound method noscope.set of <picobox._scopes.noscope object at 0x7fe02c9e9410>>
args = ('the-key', <object object at 0x7fe02e2b1850>), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
_____________________________________ test_scope_value_downstack_shared[singleton-exec_coroutine] _____________________________________
request = <FixtureRequest for <Function test_scope_value_downstack_shared[singleton-exec_coroutine]>>, scopename = 'singleton'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("singleton", "exec_thread"),
("singleton", "exec_coroutine"),
("singleton", "exec_context"),
("threadlocal", "exec_thread"),
("threadlocal", "exec_coroutine"),
("threadlocal", "exec_context"),
("contextvars", "exec_thread"),
("contextvars", "exec_coroutine"),
("contextvars", "exec_context"),
],
)
def test_scope_value_downstack_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
def caller():
scope.set("the-key", value)
return callee()
def callee():
return scope.get("the-key")
> assert exec_(caller) is value
tests/test_scopes.py:248:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <function test_scope_value_downstack_shared.<locals>.caller at 0x7fe02c9ce340>, args = (), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
____________________________________ test_scope_value_downstack_shared[threadlocal-exec_coroutine] ____________________________________
request = <FixtureRequest for <Function test_scope_value_downstack_shared[threadlocal-exec_coroutine]>>, scopename = 'threadlocal'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("singleton", "exec_thread"),
("singleton", "exec_coroutine"),
("singleton", "exec_context"),
("threadlocal", "exec_thread"),
("threadlocal", "exec_coroutine"),
("threadlocal", "exec_context"),
("contextvars", "exec_thread"),
("contextvars", "exec_coroutine"),
("contextvars", "exec_context"),
],
)
def test_scope_value_downstack_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
def caller():
scope.set("the-key", value)
return callee()
def callee():
return scope.get("the-key")
> assert exec_(caller) is value
tests/test_scopes.py:248:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <function test_scope_value_downstack_shared.<locals>.caller at 0x7fe02c9cf4c0>, args = (), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
____________________________________ test_scope_value_downstack_shared[contextvars-exec_coroutine] ____________________________________
request = <FixtureRequest for <Function test_scope_value_downstack_shared[contextvars-exec_coroutine]>>, scopename = 'contextvars'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("singleton", "exec_thread"),
("singleton", "exec_coroutine"),
("singleton", "exec_context"),
("threadlocal", "exec_thread"),
("threadlocal", "exec_coroutine"),
("threadlocal", "exec_context"),
("contextvars", "exec_thread"),
("contextvars", "exec_coroutine"),
("contextvars", "exec_context"),
],
)
def test_scope_value_downstack_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
def caller():
scope.set("the-key", value)
return callee()
def callee():
return scope.get("the-key")
> assert exec_(caller) is value
tests/test_scopes.py:248:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <function test_scope_value_downstack_shared.<locals>.caller at 0x7fe02c9ceb60>, args = (), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
____________________________________ test_scope_value_downstack_not_shared[noscope-exec_coroutine] ____________________________________
request = <FixtureRequest for <Function test_scope_value_downstack_not_shared[noscope-exec_coroutine]>>, scopename = 'noscope'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("noscope", "exec_thread"),
("noscope", "exec_coroutine"),
("noscope", "exec_context"),
],
)
def test_scope_value_downstack_not_shared(request, scopename, executor):
scope = request.getfixturevalue(scopename)
value = object()
exec_ = request.getfixturevalue(executor)
def caller():
scope.set("the-key", value)
return callee()
def callee():
return scope.get("the-key")
with pytest.raises(KeyError, match="the-key"):
> exec_(caller)
tests/test_scopes.py:272:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <function test_scope_value_downstack_not_shared.<locals>.caller at 0x7fe02ca147c0>, args = (), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
__________________________________________ test_scope_not_leaked[contextvars-exec_coroutine] __________________________________________
request = <FixtureRequest for <Function test_scope_not_leaked[contextvars-exec_coroutine]>>, scopename = 'contextvars'
executor = 'exec_coroutine'
@pytest.mark.parametrize(
"scopename, executor",
[
("threadlocal", "exec_thread"),
("contextvars", "exec_thread"),
("contextvars", "exec_coroutine"),
("contextvars", "exec_context"),
],
)
def test_scope_not_leaked(request, scopename, executor):
scope = request.getfixturevalue(scopename)
exec_ = request.getfixturevalue(executor)
scope.set("a-key", "a-value")
> exec_(scope.set, "the-key", "the-value")
tests/test_scopes.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
coroutine_function = <bound method contextvars.set of <picobox._scopes.contextvars object at 0x7fe02ca48dd0>>
args = ('the-key', 'the-value'), kwargs = {}
def executor(coroutine_function, *args, **kwargs):
if not asyncio.iscoroutinefunction(coroutine_function):
> coroutine_function = asyncio.coroutine(coroutine_function)
E AttributeError: module 'asyncio' has no attribute 'coroutine'
tests/test_scopes.py:63: AttributeError
========================================================== warnings summary ===========================================================
.tox/py311/lib/python3.11/site-packages/_pytest/config/__init__.py:1240
/tmp/picobox/.tox/py311/lib/python3.11/site-packages/_pytest/config/__init__.py:1240: PytestRemovedIn8Warning: The --strict option is deprecated, use --strict-markers instead.
self.issue_config_time_warning(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================= short test summary info =======================================================
FAILED tests/test_scopes.py::test_scope_value_shared[singleton-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_value_shared[threadlocal-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_value_not_shared[contextvars-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_value_not_shared[noscope-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_value_downstack_shared[singleton-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_value_downstack_shared[threadlocal-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_value_downstack_shared[contextvars-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_value_downstack_not_shared[noscope-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
FAILED tests/test_scopes.py::test_scope_not_leaked[contextvars-exec_coroutine] - AttributeError: module 'asyncio' has no attribute 'coroutine'
======================================== 9 failed, 1256 passed, 1 skipped, 1 warning in 2.01s =========================================
py311: exit 1 (2.29 seconds) /tmp/picobox> .tox/py311/bin/python -m pytest --strict pid=63011
.pkg: _exit> python /usr/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py311: FAIL code 1 (12.79=setup[10.50]+cmd[2.29] seconds)
evaluation failed :( (12.87 seconds)