Skip to content

Commit 238023c

Browse files
committed
Fix last Windows test failure - platform-specific invalid paths
- Use platform-aware invalid paths in test_export_handles_invalid_path - Windows: Use 'NUL:' which is a reserved device name - Linux: Use /dev/null/subdirectory which can't be created - Original test used /invalid/path which could be created on Windows - This completes Windows CI support - all tests should pass now\!
1 parent 17b38ac commit 238023c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/unit/core/test_export.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,17 @@ def test_export_handles_empty_data(self, tmp_path):
267267

268268
def test_export_handles_invalid_path(self):
269269
"""Test export handles invalid output path."""
270+
import sys
270271
db_path = Path("/tmp/test.db")
271272
exporter = DataExporter(db_path)
272273

273-
invalid_path = Path("/invalid/path/export.csv")
274+
# Use platform-specific invalid paths
275+
if sys.platform == "win32":
276+
# Windows: Use a reserved name that can't be created
277+
invalid_path = Path("NUL:/export.csv")
278+
else:
279+
# Linux/Unix: Use a path with null byte which is invalid
280+
invalid_path = Path("/dev/null/not_a_directory/export.csv")
274281

275282
with patch.object(exporter, '_get_sessions_data', return_value=[]):
276283
result = exporter.export_to_csv(invalid_path)

0 commit comments

Comments
 (0)