Skip to content

Commit

Permalink
Use Optional for type hints to ensure backward compatibility.
Browse files Browse the repository at this point in the history
Replaced PEP 604 union syntax (|) with Optional for type hints to maintain compatibility with Python versions earlier than 3.10.
  • Loading branch information
marcelotrevisani committed Feb 3, 2025
1 parent e0f10c4 commit ad55871
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pytest_replay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from dataclasses import asdict
from glob import glob
from typing import Any
from typing import Optional

import pytest

Expand Down Expand Up @@ -47,8 +48,8 @@ def pytest_addoption(parser):
class ReplayTestMetadata:
nodeid: str
start: float = 0.0
finish: float | None = None
outcome: str | None = None
finish: Optional[float] = None
outcome: Optional[str] = None
metadata: dict[str, Any] = dataclasses.field(default_factory=dict)

def to_clean_dict(self) -> dict[str, Any]:
Expand Down

0 comments on commit ad55871

Please sign in to comment.