Skip to content

Commit

Permalink
fix union type in parserjsonencoder
Browse files Browse the repository at this point in the history
Signed-off-by: joseph-sentry <[email protected]>
  • Loading branch information
joseph-sentry committed Oct 24, 2023
1 parent 3a9379b commit e5d2823
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codecov_cli/parsers/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from datetime import datetime, timedelta
from json import JSONEncoder
from typing import Any, List
from typing import Any, List, Union


class ParsingError(Exception):
Expand All @@ -10,7 +10,7 @@ class ParsingError(Exception):

class ParserJSONEncoder(JSONEncoder):
def default(self, o: Any) -> Any:
if isinstance(o, TestRunGroup | TestRun):
if isinstance(o, TestRunGroup) or isinstance(o, TestRun):
return o.__dict__
elif isinstance(o, timedelta):
return o.total_seconds()
Expand Down

0 comments on commit e5d2823

Please sign in to comment.