From 0a915831bf8430623f58cc9d785e2bf0dcfe3904 Mon Sep 17 00:00:00 2001 From: Tony Yang Date: Sun, 26 Nov 2023 15:57:12 -0800 Subject: [PATCH] update htmldate version and tests --- setup.py | 4 ++-- tests/metadata_tests.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index b7746bda..9139f853 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def get_long_description(): "brotli", "cchardet >= 2.1.7; python_version < '3.11'", # build issue "faust-cchardet >= 2.1.18; python_version >= '3.11'", # fix for build - "htmldate[speed] >= 1.5.1", + "htmldate[speed] >= 1.6.0", "py3langid >= 0.2.2", "pycurl >= 7.45.2", ], @@ -112,7 +112,7 @@ def get_long_description(): "charset_normalizer >= 3.0.1; python_version < '3.7'", "charset_normalizer >= 3.2.0; python_version >= '3.7'", "courlan >= 0.9.4", - "htmldate >= 1.5.1", + "htmldate >= 1.6.0", "justext >= 3.0.0", "lxml >= 4.9.3 ; platform_system != 'Darwin'", "lxml == 4.9.2 ; platform_system == 'Darwin'", diff --git a/tests/metadata_tests.py b/tests/metadata_tests.py index 72b7db27..27b42ddb 100644 --- a/tests/metadata_tests.py +++ b/tests/metadata_tests.py @@ -192,8 +192,9 @@ def test_dates(): mystring = '

Veröffentlicht am 1.9.17

' metadata = extract_metadata(mystring, fastmode=False) assert metadata.date == '2017-09-01' + # behavior for fastmode=True changed in htmldate==1.6.0. On 1.5.2 and earlier, result was None metadata = extract_metadata(mystring, fastmode=True) - assert metadata.date is None + assert metadata.date is '2017-09-01' def test_sitename():