jaraco.home main @ tox
.pkg: install_requires> python -I -m pip install 'setuptools>=56' 'setuptools_scm[toml]>=3.4.1'
.pkg: _optional_hooks> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_editable> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: install_requires_for_build_editable> python -I -m pip install wheel
.pkg: build_editable> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py: install_package_deps> python -I -m pip install dnspython jaraco.collections jaraco.functools jaraco.mongodb keyring 'lxml>=4.2.6' mockproc pymongo 'pytest-black>=0.3.7; platform_python_implementation != "PyPy"' 'pytest-checkdocs>=2.4' pytest-cov 'pytest-enabler>=2.2' 'pytest-mypy>=0.9.1; platform_python_implementation != "PyPy"' pytest-ruff 'pytest>=6' requests types-requests
py: install_package> python -I -m pip install --force-reinstall --no-deps /Users/jaraco/code/jaraco/jaraco.home/.tox/.tmp/package/1/jaraco.home-3.4.1.dev92+gfe890db-0.editable-py3-none-any.whl
py: commands[0]> pytest
====================================================================================== test session starts =======================================================================================
platform darwin -- Python 3.11.4, pytest-7.4.0, pluggy-1.2.0
cachedir: .tox/py/.pytest_cache
rootdir: /Users/jaraco/code/jaraco/jaraco.home
configfile: pytest.ini
plugins: checkdocs-2.10.0, black-0.3.12, mypy-0.10.3, cov-4.1.0, ruff-0.1, enabler-2.3.1, jaraco.mongodb-11.4.0
collected 25 items
conftest.py .... [ 16%]
. . [ 20%]
docs/conf.py ... [ 33%]
jaraco/home/__init__.py ... [ 45%]
jaraco/home/hdhomerun.py ...ch=none ss=80
... [ 70%]
jaraco/home/mock hdhomerun.py F.. [ 83%]
jaraco/home/thermostat.py .... [100%]
============================================================================================ FAILURES ============================================================================================
__________________________________________________________________________________________ test session __________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x107109440>, when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
@classmethod
def from_call(
cls,
func: "Callable[[], TResult]",
when: "Literal['collect', 'setup', 'call', 'teardown']",
reraise: Optional[
Union[Type[BaseException], Tuple[Type[BaseException], ...]]
] = None,
) -> "CallInfo[TResult]":
"""Call func, wrapping the result in a CallInfo.
:param func:
The function to call. Called without arguments.
:param when:
The phase in which the function is called.
:param reraise:
Exception or exceptions that shall propagate if raised by the
function, instead of being wrapped in the CallInfo.
"""
excinfo = None
start = timing.time()
precise_start = timing.perf_counter()
try:
> result: Optional[TResult] = func()
.tox/py/lib/python3.11/site-packages/_pytest/runner.py:341:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> lambda: ihook(item=item, **kwds), when=when, reraise=reraise
)
.tox/py/lib/python3.11/site-packages/_pytest/runner.py:262:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>, kwargs = {'item': <RuffItem ruff>}, firstresult = False
def __call__(self, **kwargs: object) -> Any:
assert (
not self.is_historic()
), "Cannot directly call a historic hook - use call_historic instead."
self._verify_all_args_are_provided(kwargs)
firstresult = self.spec.opts.get("firstresult", False) if self.spec else False
> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
.tox/py/lib/python3.11/site-packages/pluggy/_hooks.py:433:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0x103b80f90>, hook_name = 'pytest_runtest_call'
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/jaraco/code/jaraco/jaraco.home/.tox/py/l...rom '/Users/jaraco/code/jaraco/jaraco.home/.tox/py/lib/python3.11/site-packages/_pytest/unraisableexception.py'>>, ...]
kwargs = {'item': <RuffItem ruff>}, firstresult = False
def _hookexec(
self,
hook_name: str,
methods: Sequence[HookImpl],
kwargs: Mapping[str, object],
firstresult: bool,
) -> object | list[object]:
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
.tox/py/lib/python3.11/site-packages/pluggy/_manager.py:112:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_runtest_call'
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/jaraco/code/jaraco/jaraco.home/.tox/py/l...rom '/Users/jaraco/code/jaraco/jaraco.home/.tox/py/lib/python3.11/site-packages/_pytest/unraisableexception.py'>>, ...]
caller_kwargs = {'item': <RuffItem ruff>}, firstresult = False
def _multicall(
hook_name: str,
hook_impls: Sequence[HookImpl],
caller_kwargs: Mapping[str, object],
firstresult: bool,
) -> object | list[object]:
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results: list[object] = []
exception = None
only_new_style_wrappers = True
try: # run impl and wrapper setup functions in a loop
teardowns: list[Teardown] = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
f"hook call must provide argument {argname!r}"
)
if hook_impl.hookwrapper:
only_new_style_wrappers = False
try:
# If this cast is not valid, a type error is raised below,
# which is the desired response.
res = hook_impl.function(*args)
wrapper_gen = cast(Generator[None, _Result[object], None], res)
next(wrapper_gen) # first yield
teardowns.append((wrapper_gen,))
except StopIteration:
_raise_wrapfail(wrapper_gen, "did not yield")
elif hook_impl.wrapper:
try:
# If this cast is not valid, a type error is raised below,
# which is the desired response.
res = hook_impl.function(*args)
function_gen = cast(Generator[None, object, object], res)
next(function_gen) # first yield
teardowns.append(function_gen)
except StopIteration:
_raise_wrapfail(function_gen, "did not yield")
else:
res = hook_impl.function(*args)
if res is not None:
results.append(res)
if firstresult: # halt further impl calls
break
except BaseException as exc:
exception = exc
finally:
# Fast path - only new-style wrappers, no _Result.
if only_new_style_wrappers:
if firstresult: # first result hooks return a single value
result = results[0] if results else None
else:
result = results
# run all wrapper post-yield blocks
for teardown in reversed(teardowns):
try:
if exception is not None:
teardown.throw(exception) # type: ignore[union-attr]
else:
teardown.send(result) # type: ignore[union-attr]
# Following is unreachable for a well behaved hook wrapper.
# Try to force finalizers otherwise postponed till GC action.
# Note: close() may raise if generator handles GeneratorExit.
teardown.close() # type: ignore[union-attr]
except StopIteration as si:
result = si.value
exception = None
continue
except BaseException as e:
exception = e
continue
_raise_wrapfail(teardown, "has second yield") # type: ignore[arg-type]
if exception is not None:
raise exception.with_traceback(exception.__traceback__)
else:
return result
# Slow path - need to support old-style wrappers.
else:
if firstresult: # first result hooks return a single value
outcome: _Result[object | list[object]] = _Result(
results[0] if results else None, exception
)
else:
outcome = _Result(results, exception)
# run all wrapper post-yield blocks
for teardown in reversed(teardowns):
if isinstance(teardown, tuple):
try:
teardown[0].send(outcome)
_raise_wrapfail(teardown[0], "has second yield")
except StopIteration:
pass
else:
try:
if outcome._exception is not None:
teardown.throw(outcome._exception)
else:
teardown.send(outcome._result)
# Following is unreachable for a well behaved hook wrapper.
# Try to force finalizers otherwise postponed till GC action.
# Note: close() may raise if generator handles GeneratorExit.
teardown.close()
except StopIteration as si:
outcome.force_result(si.value)
continue
except BaseException as e:
outcome.force_exception(e)
continue
_raise_wrapfail(teardown, "has second yield")
> return outcome.get_result()
.tox/py/lib/python3.11/site-packages/pluggy/_callers.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pluggy._result._Result object at 0x11547fd30>
def get_result(self) -> _T:
"""Get the result(s) for this hook call.
If the hook was marked as a ``firstresult`` only a single value
will be returned, otherwise a list of results.
"""
__tracebackhide__ = True
exc = self._exception
if exc is None:
return cast(_T, self._result)
else:
> raise exc.with_traceback(exc.__traceback__)
.tox/py/lib/python3.11/site-packages/pluggy/_result.py:108:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_runtest_call'
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/jaraco/code/jaraco/jaraco.home/.tox/py/l...rom '/Users/jaraco/code/jaraco/jaraco.home/.tox/py/lib/python3.11/site-packages/_pytest/unraisableexception.py'>>, ...]
caller_kwargs = {'item': <RuffItem ruff>}, firstresult = False
def _multicall(
hook_name: str,
hook_impls: Sequence[HookImpl],
caller_kwargs: Mapping[str, object],
firstresult: bool,
) -> object | list[object]:
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results: list[object] = []
exception = None
only_new_style_wrappers = True
try: # run impl and wrapper setup functions in a loop
teardowns: list[Teardown] = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
f"hook call must provide argument {argname!r}"
)
if hook_impl.hookwrapper:
only_new_style_wrappers = False
try:
# If this cast is not valid, a type error is raised below,
# which is the desired response.
res = hook_impl.function(*args)
wrapper_gen = cast(Generator[None, _Result[object], None], res)
next(wrapper_gen) # first yield
teardowns.append((wrapper_gen,))
except StopIteration:
_raise_wrapfail(wrapper_gen, "did not yield")
elif hook_impl.wrapper:
try:
# If this cast is not valid, a type error is raised below,
# which is the desired response.
res = hook_impl.function(*args)
function_gen = cast(Generator[None, object, object], res)
next(function_gen) # first yield
teardowns.append(function_gen)
except StopIteration:
_raise_wrapfail(function_gen, "did not yield")
else:
> res = hook_impl.function(*args)
.tox/py/lib/python3.11/site-packages/pluggy/_callers.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <RuffItem ruff>
def pytest_runtest_call(item: Item) -> None:
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
item.runtest()
except Exception as e:
# Store trace info to allow postmortem debugging
sys.last_type = type(e)
sys.last_value = e
assert e.__traceback__ is not None
# Skip *this* frame
sys.last_traceback = e.__traceback__.tb_next
> raise e
.tox/py/lib/python3.11/site-packages/_pytest/runner.py:177:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <RuffItem ruff>
def pytest_runtest_call(item: Item) -> None:
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
> item.runtest()
.tox/py/lib/python3.11/site-packages/_pytest/runner.py:169:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <RuffItem ruff>
def runtest(self):
> check_file(self.fspath)
.tox/py/lib/python3.11/site-packages/pytest_ruff.py:73:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = local('/Users/jaraco/code/jaraco/jaraco.home/jaraco/home/mock hdhomerun.py')
def check_file(path):
ruff = find_ruff_bin()
command = f"{ruff} {path} --quiet --show-source"
child = Popen(command, shell=True, stdout=PIPE, stderr=PIPE)
stdout, _ = child.communicate()
if stdout:
> raise RuffError(stdout.decode())
E pytest_ruff.RuffError: hdhomerun.py:1:1: E902 No such file or directory (os error 2)
E |
E |
E
E jaraco/home/mock:1:1: E902 No such file or directory (os error 2)
E |
E |
.tox/py/lib/python3.11/site-packages/pytest_ruff.py:88: RuffError
======================================================================================== warnings summary ========================================================================================
jaraco/home/hdhomerun.py::home.hdhomerun.gather_status
/Users/jaraco/code/jaraco/jaraco.home/conftest.py:24: EncodingWarning: 'encoding' argument not specified
script = files('jaraco.home').joinpath('mock hdhomerun.py').read_text()
jaraco/home/hdhomerun.py::home.hdhomerun.gather_status
/Users/jaraco/code/jaraco/jaraco.home/.tox/py/lib/python3.11/site-packages/mockproc/mockprocess.py:53: EncodingWarning: 'encoding' argument not specified
fh = open( filename, 'w' )
jaraco/home/hdhomerun.py::home.hdhomerun.gather_status
/Users/jaraco/code/jaraco/jaraco.home/jaraco/home/hdhomerun.py:46: EncodingWarning: 'encoding' argument not specified.
return parse_devices(subprocess.check_output(cmd, text=True))
jaraco/home/hdhomerun.py::home.hdhomerun.gather_status
jaraco/home/hdhomerun.py::home.hdhomerun.gather_status
jaraco/home/hdhomerun.py::home.hdhomerun.get_status
/Users/jaraco/code/jaraco/jaraco.home/jaraco/home/hdhomerun.py:56: EncodingWarning: 'encoding' argument not specified.
line = subprocess.check_output(cmd, text=True)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------- coverage: platform darwin, python 3.11.4-final-0 ----------
Name Stmts Miss Cover Missing
-------------------------------------------------------------
conftest.py 15 0 100%
docs/conf.py 9 0 100%
jaraco/home/__init__.py 0 0 100%
jaraco/home/hdhomerun.py 92 28 70% 84, 108, 112-120, 124-127, 132-136, 140, 144-155, 159-163
jaraco/home/mock hdhomerun.py 8 5 38% 7-11
jaraco/home/thermostat.py 56 31 45% 28-29, 33-36, 41, 54-55, 58, 65, 69, 72-80, 86-87, 90-91, 98-101, 106-107
-------------------------------------------------------------
TOTAL 180 64 64%
============================================================================================== mypy ==============================================================================================
Success: no issues found in 6 source files
==================================================================================== short test summary info =====================================================================================
FAILED jaraco/home/mock hdhomerun.py::ruff - pytest_ruff.RuffError: hdhomerun.py:1:1: E902 No such file or directory (os error 2)
=========================================================================== 1 failed, 23 passed, 6 warnings in 17.43s ============================================================================
py: exit 1 (19.11 seconds) /Users/jaraco/code/jaraco/jaraco.home> pytest pid=86287
.pkg: _exit> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py: FAIL code 1 (30.02=setup[10.91]+cmd[19.11] seconds)
evaluation failed :( (30.12 seconds)