Skip to content

Commit

Permalink
🐛 Fix comparing directories on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalkrupinski committed Feb 24, 2024
1 parent 45a6ea9 commit 54748fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

def dir_content(root: Path) -> Iterable[Tuple[str, Optional[str]]]:
return sorted(
(str(path.relative_to(root)), path.read_text() if path.is_file() else None) for path in root.rglob('*')
(path.relative_to(root).as_posix(), path.read_text() if path.is_file() else None) for path in root.rglob('*')
)
4 changes: 2 additions & 2 deletions tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def test_callback(tmp_path: pathlib.Path):

class ReportingEventSink(rybak.EventSink):
def writing_file(self, template: pathlib.PurePath, target: pathlib.Path) -> None:
logs.add((str(template), str(target)))
logs.add((template.as_posix(), target.as_posix()))

def unlinking_file(self, target: pathlib.Path) -> None:
logs.add((None, str(target)))
logs.add((None, target.as_posix()))

(tmp_path / 'stale_file.txt').write_text('test file')

Expand Down

0 comments on commit 54748fc

Please sign in to comment.