Skip to content

Instantly share code, notes, and snippets.

@simonw
Created May 8, 2023 19:59
Show Gist options
  • Save simonw/b40b3e814729d6c02a0302a84ce54d9e to your computer and use it in GitHub Desktop.
Save simonw/b40b3e814729d6c02a0302a84ce54d9e to your computer and use it in GitHub Desktop.
(sqlite-utils) simon@Simons-MacBook-Pro sqlite-utils % pytest -Werror
============================================================================================================ test session starts ============================================================================================================
platform darwin -- Python 3.11.2, pytest-7.2.2, pluggy-1.0.0
rootdir: /Users/simon/Dropbox/Development/sqlite-utils
plugins: hypothesis-6.68.2
collected 907 items
tests/test_analyze.py .... [ 0%]
tests/test_analyze_tables.py ..... [ 0%]
tests/test_attach.py . [ 1%]
tests/test_cli.py ......................................................................................E.......................................................................sss [ 18%]
tests/test_cli_bulk.py ... [ 19%]
tests/test_cli_convert.py ....................................... [ 23%]
tests/test_cli_insert.py ...................................... [ 27%]
tests/test_cli_memory.py ....FFF.F......F.........F. [ 30%]
tests/test_column_affinity.py ...................................................... [ 36%]
tests/test_constructor.py ...... [ 37%]
tests/test_conversions.py ...... [ 37%]
tests/test_convert.py .............. [ 39%]
tests/test_create.py ......................................................................................................s............................. [ 54%]
tests/test_create_view.py ...... [ 54%]
tests/test_delete.py ..... [ 55%]
tests/test_docs.py ............................................................................................ [ 65%]
tests/test_duplicate.py .. [ 65%]
tests/test_enable_counts.py ....... [ 66%]
tests/test_extract.py .......... [ 67%]
tests/test_extracts.py ...... [ 68%]
tests/test_fts.py ............................................. [ 73%]
tests/test_get.py ...... [ 73%]
tests/test_gis.py ............ [ 75%]
tests/test_hypothesis.py .... [ 75%]
tests/test_insert_files.py ....... [ 76%]
tests/test_introspect.py .......................................... [ 80%]
tests/test_lookup.py ...... [ 81%]
tests/test_m2m.py ........... [ 82%]
tests/test_query.py .. [ 83%]
tests/test_recipes.py ......FF.......... [ 85%]
tests/test_recreate.py ...... [ 85%]
tests/test_register_function.py ...... [ 86%]
tests/test_rows.py ................ [ 88%]
tests/test_rows_from_file.py ...... [ 88%]
tests/test_sniff.py .... [ 89%]
tests/test_suggest_column_types.py ................ [ 90%]
tests/test_tracer.py .. [ 91%]
tests/test_transform.py ....................................... [ 95%]
tests/test_update.py ................... [ 97%]
tests/test_upsert.py ......... [ 98%]
tests/test_utils.py ............ [ 99%]
tests/test_wal.py . [100%]
================================================================================================================== ERRORS ===================================================================================================================
___________________________________________________________________________________________________ ERROR at setup of test_upsert_analyze ___________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x10527e840>, when = 'setup', 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:83: in pytest_runtest_setup
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E
E Traceback (most recent call last):
E File "/Users/simon/.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/fixtures.py", line 580, in _get_active_fixturedef
E return self._fixture_defs[argname]
E ~~~~~~~~~~~~~~~~~~^^^^^^^^^
E KeyError: 'request'
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/Users/simon/.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/fixtures.py", line 1666, in getfixturedefs
E fixturedefs = self._arg2fixturedefs[argname]
E ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
E ResourceWarning: unclosed file <_io.FileIO name='/private/var/folders/x6/31xf1vxj0nn9mxqq8z0mmcfw0000gn/T/pytest-of-simon/pytest-99/test_upsert_pk_required0/dogs.json' mode='rb' closefd=True>
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
================================================================================================================= FAILURES ==================================================================================================================
________________________________________________________________________________________________________ test_memory_csv[False-test] ________________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x1052ea160>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E
E Traceback (most recent call last):
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/utils.py", line 209, in _extra_key_strategy
E for row in reader:
E ResourceWarning: unclosed file <_io.TextIOWrapper name='/private/var/folders/x6/31xf1vxj0nn9mxqq8z0mmcfw0000gn/T/pytest-of-simon/pytest-99/test_memory_csv_False_test_0/test.csv' encoding='utf-8-sig'>
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
_________________________________________________________________________________________________________ test_memory_csv[False-t] __________________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x1052c4ae0>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E
E Traceback (most recent call last):
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/utils.py", line 209, in _extra_key_strategy
E for row in reader:
E ResourceWarning: unclosed file <_io.TextIOWrapper name='/private/var/folders/x6/31xf1vxj0nn9mxqq8z0mmcfw0000gn/T/pytest-of-simon/pytest-99/test_memory_csv_False_t_0/test.csv' encoding='utf-8-sig'>
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
_________________________________________________________________________________________________________ test_memory_csv[False-t1] _________________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x104717100>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E
E Traceback (most recent call last):
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/utils.py", line 209, in _extra_key_strategy
E for row in reader:
E ResourceWarning: unclosed file <_io.TextIOWrapper name='/private/var/folders/x6/31xf1vxj0nn9mxqq8z0mmcfw0000gn/T/pytest-of-simon/pytest-99/test_memory_csv_False_t1_0/test.csv' encoding='utf-8-sig'>
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
__________________________________________________________________________________________________________ test_memory_tsv[False] ___________________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x105258c20>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E
E Traceback (most recent call last):
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/utils.py", line 209, in _extra_key_strategy
E for row in reader:
E ResourceWarning: unclosed file <_io.TextIOWrapper name='/private/var/folders/x6/31xf1vxj0nn9mxqq8z0mmcfw0000gn/T/pytest-of-simon/pytest-99/test_memory_tsv_False_0/chickens.tsv' encoding='utf-8-sig'>
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
_______________________________________________________________________________________________________ test_memory_dump[extra_args0] _______________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x10525b6a0>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E
E Traceback (most recent call last):
E File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/csv.py", line 322, in _guess_delimiter
E items = list(charFrequency[char].items())
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E ResourceWarning: unclosed file <_io.FileIO name='/private/var/folders/x6/31xf1vxj0nn9mxqq8z0mmcfw0000gn/T/pytest-of-simon/pytest-99/test_memory_csv_encoding_False0/test.csv' mode='rb' closefd=True>
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
___________________________________________________________________________________________________ test_memory_two_files_with_same_stem ____________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x10524a980>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E
E Traceback (most recent call last):
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/utils.py", line 209, in _extra_key_strategy
E for row in reader:
E ResourceWarning: unclosed file <_io.TextIOWrapper name='/private/var/folders/x6/31xf1vxj0nn9mxqq8z0mmcfw0000gn/T/pytest-of-simon/pytest-99/test_memory_two_files_with_sam0/two/data.csv' encoding='utf-8-sig'>
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
___________________________________________________________________________________________________ test_dateparse_errors[None-parsedate] ___________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x1048959e0>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Table.convert.<locals>.convert_value at 0x107dab880>
E
E Traceback (most recent call last):
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/db.py", line 2665, in convert_value
E return jsonify_if_needed(fn(v))
E ^^^^^
E File "/Users/simon/Dropbox/Development/sqlite-utils/tests/test_recipes.py", line 77, in <lambda>
E fresh_db["example"].convert("dt", lambda value: getattr(recipes, fn)(value))
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/recipes.py", line 19, in parsedate
E parser.parse(value, dayfirst=dayfirst, yearfirst=yearfirst)
E File "/Users/simon/.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/dateutil/parser/_parser.py", line 1368, in parse
E return DEFAULTPARSER.parse(timestr, **kwargs)
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/Users/simon/.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/dateutil/parser/_parser.py", line 643, in parse
E raise ParserError("Unknown string format: %s", timestr)
E dateutil.parser._parser.ParserError: Unknown string format: invalid
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
_________________________________________________________________________________________________ test_dateparse_errors[None-parsedatetime] _________________________________________________________________________________________________
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x107cb5d00>, 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()
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/runner.py:260: in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in"
msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
msg += "".join(
traceback.format_exception(
cm.unraisable.exc_type,
cm.unraisable.exc_value,
cm.unraisable.exc_traceback,
)
)
> warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Table.convert.<locals>.convert_value at 0x107daa660>
E
E Traceback (most recent call last):
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/db.py", line 2665, in convert_value
E return jsonify_if_needed(fn(v))
E ^^^^^
E File "/Users/simon/Dropbox/Development/sqlite-utils/tests/test_recipes.py", line 77, in <lambda>
E fresh_db["example"].convert("dt", lambda value: getattr(recipes, fn)(value))
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/Users/simon/Dropbox/Development/sqlite-utils/sqlite_utils/recipes.py", line 42, in parsedatetime
E return parser.parse(value, dayfirst=dayfirst, yearfirst=yearfirst).isoformat()
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/Users/simon/.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/dateutil/parser/_parser.py", line 1368, in parse
E return DEFAULTPARSER.parse(timestr, **kwargs)
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/Users/simon/.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/dateutil/parser/_parser.py", line 643, in parse
E raise ParserError("Unknown string format: %s", timestr)
E dateutil.parser._parser.ParserError: Unknown string format: invalid
../../../.local/share/virtualenvs/sqlite-utils-C4Ilevlm/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning
========================================================================================================== short test summary info ==========================================================================================================
FAILED tests/test_cli_memory.py::test_memory_csv[False-test] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/test_cli_memory.py::test_memory_csv[False-t] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/test_cli_memory.py::test_memory_csv[False-t1] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/test_cli_memory.py::test_memory_tsv[False] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/test_cli_memory.py::test_memory_dump[extra_args0] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/test_cli_memory.py::test_memory_two_files_with_same_stem - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/test_recipes.py::test_dateparse_errors[None-parsedate] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Table.convert.<locals>.convert_value at 0x107dab880>
FAILED tests/test_recipes.py::test_dateparse_errors[None-parsedatetime] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Table.convert.<locals>.convert_value at 0x107daa660>
ERROR tests/test_cli.py::test_upsert_analyze - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
============================================================================================= 8 failed, 894 passed, 4 skipped, 1 error in 6.29s =============================================================================================
(sqlite-utils) simon@Simons-MacBook-Pro sqlite-utils %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment