Try to get the file which actually contains the doctest, not the filename of the document it's included in.
(self, node: Node, docname: str)
| 387 | break |
| 388 | |
| 389 | def get_filename_for_node(self, node: Node, docname: str) -> str: |
| 390 | """Try to get the file which actually contains the doctest, not the |
| 391 | filename of the document it's included in. |
| 392 | """ |
| 393 | try: |
| 394 | filename = relpath(node.source, self.env.srcdir) # type: ignore[arg-type] |
| 395 | return filename.partition(':docstring of ')[0] |
| 396 | except Exception: |
| 397 | return str(self.env.doc2path(docname, False)) |
| 398 | |
| 399 | @staticmethod |
| 400 | def get_line_number(node: Node) -> int | None: |