simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.62k stars 109 forks source link

Get tests to pass with `pytest -Werror` #541

Open simonw opened 1 year ago

simonw commented 1 year ago

Inspired by:

simonw commented 1 year ago

There are 8 failing tests left:

==== 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 0x106bcaca0>
FAILED tests/test_recipes.py::test_dateparse_errors[None-parsedatetime] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Table.convert.<locals>.convert_value at 0x106bc9620>
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.27s ====

Full traceback here: https://gist.github.com/simonw/b40b3e814729d6c02a0302a84ce54d9e

lbellomo commented 5 months ago

I made a new run and found a few more cases. I can try to make a PR to fix them.

==== short test summary info ====
FAILED tests/test_cli.py::test_upsert_analyze - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ...
FAILED tests/test_cli_memory.py::test_memory_csv[False-test] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ...
FAILED tests/test_cli_memory.py::test_memory_csv[False-t] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ...
FAILED tests/test_cli_memory.py::test_memory_csv[False-t1] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ...
FAILED tests/test_cli_memory.py::test_memory_tsv[False] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ...
FAILED tests/test_cli_memory.py::test_memory_dump[extra_args1] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ...
FAILED tests/test_cli_memory.py::test_memory_two_files_with_same_stem - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ...
FAILED tests/test_insert_files.py::test_insert_files[pk_args0-expected_pks0-False] - DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and ...
FAILED tests/test_insert_files.py::test_insert_files[pk_args0-expected_pks0-True] - DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and ...
FAILED tests/test_insert_files.py::test_insert_files[pk_args1-expected_pks1-False] - DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and ...
FAILED tests/test_insert_files.py::test_insert_files[pk_args1-expected_pks1-True] - DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and ...
FAILED tests/test_recipes.py::test_dateparse_errors[None-parsedate] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Ta...
FAILED tests/test_recipes.py::test_dateparse_errors[None-parsedatetime] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Ta...
==== 13 failed, 972 passed, 16 skipped in 10.54s =====