- Improvements:
- Fixed issue with regex library by pinning dependencies to
an earlier version
- Extended support for Russian language dates starting with
lowercase
- Allowed to use_given_order for languages too
- Fixed link to settings section
- Defined UTF-8 encoding for Windows
- Fixed directories creation error in CLI utils
- Update to 1.1.0:
- New features:
- Support language detection based on langdetect, fastText,
or a custom implementation
- Add support for 'by '
- Sort default language list by internet usage
- Improvements:
- Improved support of Chinese
- Improvements in search_dates
- Make order of previous locales deterministic
- Fix parsing with trailing space
- Consider RETURN_TIME_AS_PERIOD for timestamp times
- Exclude failing regex version
- Ongoing work multithreading support
- Add demo URL
- QA:
- Migrate pipelines from Travis CI to Github Actions
- Use versioned CLDR data
- Add a script to update table of supported languages and
locales
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dateparser?expand=0&rev=14
33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
---
|
|
tests/test_language_detect.py | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
--- a/tests/test_language_detect.py
|
|
+++ b/tests/test_language_detect.py
|
|
@@ -1,6 +1,8 @@
|
|
+import os
|
|
+import unittest
|
|
+
|
|
from datetime import datetime
|
|
from unittest.mock import Mock
|
|
-import unittest
|
|
|
|
from parameterized import parameterized, param
|
|
|
|
@@ -13,6 +15,7 @@ from dateparser.search import search_dat
|
|
detect_languages = Mock()
|
|
detect_languages.return_value = ["en"]
|
|
|
|
+NO_NETWORK = int(os.environ.get('NO_NETWORK', 0)) == 1
|
|
|
|
class CustomLangDetectParserTest(unittest.TestCase):
|
|
def check_is_returned_list(self):
|
|
@@ -22,6 +25,7 @@ class CustomLangDetectParserTest(unittes
|
|
param(dt_string="14 June 2020", confidence_threshold=0.0),
|
|
param(dt_string="26 July 2021", confidence_threshold=0.0)
|
|
])
|
|
+ @unittest.skipIf(NO_NETWORK, "Test requires network access")
|
|
def test_custom_language_detect_fast_text(self, dt_string, confidence_threshold):
|
|
self.result = fast_text_detect_languages(dt_string, confidence_threshold)
|
|
self.check_is_returned_list()
|