Skip to content

Commit

Permalink
Fix fragile test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pvk-developer committed Apr 23, 2024
1 parent e44c89e commit ad0fab9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/unit/io/test_local.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Unit tests for local file handlers."""
import os
import re
from pathlib import Path
from unittest.mock import patch

Expand Down Expand Up @@ -151,7 +152,8 @@ def test_write_file_exists(self, tmpdir):
handler = CSVHandler()

# Run
with pytest.raises(FileExistsError, match=f"{tmpdir / 'synthetic_data' / 'table1.csv'}"):
error_msg = re.escape(f"{tmpdir / 'synthetic_data' / 'table1.csv'}")
with pytest.raises(FileExistsError, match=error_msg):
handler.write(synthetic_data, tmpdir / 'synthetic_data')

def test_write_file_exists_mode_is_a(self, tmpdir):
Expand Down

0 comments on commit ad0fab9

Please sign in to comment.