17
0
Files
python-dateparser/mark-network-tests.patch
Nico Krapp 0260a73517 - Update to 1.2.2
* Fix PytzUsageWarning
  * Avoid repeated loop over timezones
  * Migrate from hijri-converter to hijridate
  * Set minimum versions for dependencies
  * Limited numpy to 1.x when installing dateparser[fasttext]
  * Handle the Russian preposition “с”
  * Fix weekday search
  * Add Python 3.14 support
  * Cache timezone offsets to improve import time

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dateparser?expand=0&rev=45
2025-09-15 14:12:26 +00:00

33 lines
1.2 KiB
Diff

---
tests/test_language_detect.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: dateparser-1.2.2/tests/test_language_detect.py
===================================================================
--- dateparser-1.2.2.orig/tests/test_language_detect.py
+++ dateparser-1.2.2/tests/test_language_detect.py
@@ -2,6 +2,7 @@ import pytest
pytest.importorskip("fasttext")
+import os
import unittest
from datetime import datetime
from unittest.mock import Mock
@@ -21,6 +22,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):
@@ -32,6 +34,7 @@ class CustomLangDetectParserTest(unittes
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()