Skip to content

Commit

Permalink
some more type annotations (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiwei authored Feb 21, 2024
1 parent 0ae5186 commit f433768
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions junitparser/junitparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import itertools
from copy import deepcopy
from typing import List

try:
from lxml import etree
Expand Down Expand Up @@ -552,7 +553,7 @@ def __iadd__(self, other):
result.add_testsuite(other)
return result

def remove_testcase(self, testcase):
def remove_testcase(self, testcase: TestCase):
"""Remove testcase *testcase* from the testsuite."""
for case in self:
if case == testcase:
Expand Down Expand Up @@ -580,7 +581,7 @@ def update_statistics(self):
self.skipped = skipped
self.time = round(time, 3)

def add_property(self, name, value):
def add_property(self, name: str, value: str):
"""Add a property *name* = *value* to the testsuite.
See :class:`Property` and :class:`Properties`.
Expand All @@ -593,17 +594,17 @@ def add_property(self, name, value):
prop = Property(name, value)
props.add_property(prop)

def add_testcase(self, testcase):
def add_testcase(self, testcase: TestCase):
"""Add a testcase *testcase* to the testsuite."""
self.append(testcase)
self.update_statistics()

def add_testcases(self, testcases):
def add_testcases(self, testcases: List[TestCase]):
"""Add testcases *testcases* to the testsuite."""
self.extend(testcases)
self.update_statistics()

def _add_testcase_no_update_stats(self, testcase):
def _add_testcase_no_update_stats(self, testcase: TestCase):
"""Add *testcase* to the testsuite (without updating statistics).
For internal use only to avoid quadratic behaviour in merge.
Expand Down

0 comments on commit f433768

Please sign in to comment.