Skip to content

Commit

Permalink
Make DropTestCaseBuilder instance truely stateless
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Jul 6, 2022
1 parent dd6c641 commit ef4c57a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python/publish/junit.py
Expand Up @@ -84,12 +84,9 @@ def get_content(results: Union[Element, List[Element]]) -> str:


class DropTestCaseBuilder(etree.TreeBuilder):
_stack = []

def parse(self, filepath):
self._stack.clear()
parser = etree.XMLParser(target=self)
return etree.parse(filepath, parser=parser)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._stack = []

def start(self, tag: Union[str, bytes], attrs: Dict[Union[str, bytes], Union[str, bytes]]) -> Element:
self._stack.append(tag)
Expand Down

0 comments on commit ef4c57a

Please sign in to comment.