From 5dc113d3778b187dff0b4ee1e787a767e5e2128f Mon Sep 17 00:00:00 2001 From: River739 Date: Wed, 27 Aug 2025 23:44:44 +0530 Subject: [PATCH 1/2] Add venv to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0e5d8cc40..772df421a 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ docs/_build/ docs/_autosummary/ docs/_images/*.png docs/normal_data.csv +venv/ From 4f12671424ac30bb75029883b5f3a3d2e521d3d9 Mon Sep 17 00:00:00 2001 From: River739 Date: Wed, 27 Aug 2025 23:45:25 +0530 Subject: [PATCH 2/2] Fix regex escape sequence warning in test_formats.py --- tests/test_formats.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_formats.py b/tests/test_formats.py index c09fccfb5..9659afd3c 100644 --- a/tests/test_formats.py +++ b/tests/test_formats.py @@ -4,11 +4,12 @@ from datascience import formats import os import time +import pytest def assert_equal(string1, string2): string1, string2 = str(string1), str(string2) - whitespace = re.compile('\s') + whitespace = re.compile(r'\s') purify = lambda s: whitespace.sub('', s) assert purify(string1) == purify(string2), "\n%s\n!=\n%s" % (string1, string2) @@ -92,11 +93,15 @@ def test_date_format(): t.set_format('time', ds.DateFormatter("%Y-%m-%d %H:%M:%S.%f")) assert isinstance(t['time'][0], float) - +@pytest.mark.skipif( + not hasattr(time, "tzset"), + reason="time.tzset not available on this platform" +) def test_date_formatter_format_value(): formatter = formats.DateFormatter() os.environ["TZ"] = "UTC" - time.tzset() + if hasattr(time, "tzset"): # ✅ only call tzset if it exists + time.tzset() assert_equal(formatter.format_value(1666264489.9004), "2022-10-20 11:14:49.900400")