Skip to content

Commit

Permalink
Remove unnecessary list comprehensions (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
markgras authored Dec 30, 2021
1 parent ae78dd6 commit 232c21a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions junitparser/junitparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def __repr__(self):
keys = sorted(self._elem.attrib.keys())
if keys:
attrs_str = " ".join(
['%s="%s"' % (key, self._elem.attrib[key]) for key in keys]
'%s="%s"' % (key, self._elem.attrib[key]) for key in keys
)
return """<Element '%s' %s>""" % (tag, attrs_str)

Expand Down Expand Up @@ -364,11 +364,11 @@ def __init__(self, name=None):
def __iter__(self):
return itertools.chain(
super(TestSuite, self).iterchildren(TestCase),
[
(
case
for suite in super(TestSuite, self).iterchildren(TestSuite)
for case in suite
],
),
)

def __len__(self):
Expand All @@ -383,7 +383,7 @@ def props_eq(props1, props2):
props1.sort(key=lambda x: x.name)
props2.sort(key=lambda x: x.name)
zipped = zip(props1, props2)
return all([x == y for x, y in zipped])
return all(x == y for x, y in zipped)

return (
self.name == other.name
Expand Down

0 comments on commit 232c21a

Please sign in to comment.