Skip to content

Commit

Permalink
Remove static state from DropTestCaseBuilder (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi authored Jul 6, 2022
1 parent dd6c641 commit a0006c8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python/publish/junit.py
Original file line number Diff line number Diff line change
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 a0006c8

Please sign in to comment.