summaryrefslogtreecommitdiff
path: root/coverage/types.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/types.py')
-rw-r--r--coverage/types.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/coverage/types.py b/coverage/types.py
index b8135d05..e01f451e 100644
--- a/coverage/types.py
+++ b/coverage/types.py
@@ -7,9 +7,12 @@ Types for use throughout coverage.py.
from __future__ import annotations
+import os
+import pathlib
+
from types import FrameType, ModuleType
from typing import (
- Any, Callable, Dict, Iterable, List, Mapping, Optional, Set, Tuple, Union,
+ Any, Callable, Dict, Iterable, List, Mapping, Optional, Set, Tuple, Type, Union,
TYPE_CHECKING,
)
@@ -23,6 +26,14 @@ else:
class Protocol: # pylint: disable=missing-class-docstring
pass
+## File paths
+
+# For arguments that are file paths:
+FilePath = Union[str, os.PathLike]
+# For testing FilePath arguments
+FilePathClasses = [str, pathlib.Path]
+FilePathType = Union[Type[str], Type[pathlib.Path]]
+
## Python tracing
class TTraceFn(Protocol):