Skip to content

Commit

Permalink
Ignore path delimiter in doctest to support Windows
Browse files Browse the repository at this point in the history
Otherwise, this fails on Windows which returns "file\\with\\..."
  • Loading branch information
lagru committed Sep 20, 2024
1 parent c1cdb03 commit e6ab000
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/docstub/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ class ContextFormatter:
>>> from pathlib import Path
>>> ctx = ContextFormatter(path=Path("file/with/problems.py"))
>>> ctx.format_message("Message")
'file/with/problems.py: Message'
'...problems.py: Message'
>>> ctx.with_line(3).format_message("Message with line info")
'file/with/problems.py:3: Message with line info'
'...problems.py:3: Message with line info'
>>> ctx.with_line(3).with_column(2).format_message("Message with column info")
'file/with/problems.py:3:2: Message with column info'
'...problems.py:3:2: Message with column info'
"""

path: Path = None
Expand Down

0 comments on commit e6ab000

Please sign in to comment.