Skip to content

Some DeprecationWarning in test suite with Python 3.14 #669

@terjeros

Description

@terjeros

Runing test suite with Python 3.14 is somewhat noisy, following warnings are seen:

tests/test_insert_files.py: 12 warnings
  /builddir/build/BUILD/python-sqlite-utils-3.38-build/sqlite_utils-3.38/sqlite_utils/cli.py:3206: DeprecationWarning: datetime.date
time.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetim
es in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    "mtime_iso": lambda p: datetime.utcfromtimestamp(p.stat().st_mtime).isoformat(),
tests/test_insert_files.py: 12 warnings
  /builddir/build/BUILD/python-sqlite-utils-3.38-build/sqlite_utils-3.38/sqlite_utils/cli.py:3207: DeprecationWarning: datetime.date
time.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetim
es in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    "ctime_iso": lambda p: datetime.utcfromtimestamp(p.stat().st_ctime).isoformat(),
tests/test_recipes.py::test_dateparse_errors[None-parsedate]
  /usr/lib/python3.14/site-packages/_pytest/unraisableexception.py:85: PytestUnraisableExceptionWarning: Exception ignored on sqlite
3 callback <function Table.convert.<locals>.convert_value at 0x7fde5f4c2090>: None
  
  Traceback (most recent call last):
    File "/builddir/build/BUILD/python-sqlite-utils-3.38-build/sqlite_utils-3.38/sqlite_utils/db.py", line 2886, in convert_value
      return jsonify_if_needed(fn(v))
                               ~~^^^
    File "/builddir/build/BUILD/python-sqlite-utils-3.38-build/sqlite_utils-3.38/tests/test_recipes.py", line 77, in <lambda>
      fresh_db["example"].convert("dt", lambda value: getattr(recipes, fn)(value))
                                                      ~~~~~~~~~~~~~~~~~~~~^^^^^^^
    File "/builddir/build/BUILD/python-sqlite-utils-3.38-build/sqlite_utils-3.38/sqlite_utils/recipes.py", line 19, in parsedate
      parser.parse(value, dayfirst=dayfirst, yearfirst=yearfirst)
      ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.14/site-packages/dateutil/parser/_parser.py", line 1368, in parse
      return DEFAULTPARSER.parse(timestr, **kwargs)
             ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.14/site-packages/dateutil/parser/_parser.py", line 643, in parse
      raise ParserError("Unknown string format: %s", timestr)
  dateutil.parser._parser.ParserError: Unknown string format: invalid
  
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
tests/test_recipes.py::test_dateparse_errors[None-parsedatetime]
  /usr/lib/python3.14/site-packages/_pytest/unraisableexception.py:85: PytestUnraisableExceptionWarning: Exception ignored on sqlite

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions