File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import re
1212import warnings
1313from pathlib import Path
14- from typing import Optional
14+ from typing import TYPE_CHECKING
1515
1616import pytest
17- from _pytest .capture import CaptureFixture
1817
18+ if TYPE_CHECKING :
19+ from _pytest .capture import CaptureFixture
1920
20- def find_project_root (start_path : Optional [Path ]) -> Path :
21+
22+ def find_project_root (start_path : Path | None ) -> Path :
2123 """Find the project root directory by looking for the .git folder.
2224
2325 This function iterates up the directory tree from the given starting path
@@ -96,7 +98,7 @@ def docstring(project_root: Path) -> str:
9698 return docstring
9799
98100 except FileNotFoundError :
99- warnings .warn ("README.md file not found" )
101+ warnings .warn ("README.md file not found" , stacklevel = 2 )
100102 return ""
101103
102104
You can’t perform that action at this time.
0 commit comments