Skip to content

Commit 3353b98

Browse files
Skip timezone test when pytz is not available
1 parent 44fb893 commit 3353b98

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/test_engine.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
)
2424

2525

26+
def _has_pytz() -> bool:
27+
"""Check if pytz is available (needed for DuckDB TIMESTAMPTZ)."""
28+
try:
29+
import pytz # noqa: F401
30+
31+
return True
32+
except ImportError:
33+
return False
34+
35+
2636
class TestBuildBasic:
2737
"""Core build functionality tests."""
2838

@@ -1390,6 +1400,9 @@ def test_duplicate_warns_on_keep_any(self, tmp_path):
13901400
class TestTimezoneMismatch:
13911401
"""Build should raise TimefenceTimezoneError when tz-aware meets tz-naive."""
13921402

1403+
@pytest.mark.skipif(
1404+
not _has_pytz(), reason="pytz required for TIMESTAMPTZ support in DuckDB"
1405+
)
13931406
def test_tz_aware_labels_vs_naive_features(self, tmp_path):
13941407
"""TIMESTAMPTZ labels + TIMESTAMP features → timezone error."""
13951408
conn = duckdb.connect()

0 commit comments

Comments
 (0)