minor: LFPlugin: de-indent code by returning if not active
This commit is contained in:
parent
19035f4b55
commit
1d137fd2fe
|
@ -179,7 +179,9 @@ class LFPlugin(object):
|
|||
self.lastfailed[report.nodeid] = True
|
||||
|
||||
def pytest_collection_modifyitems(self, session, config, items):
|
||||
if self.active:
|
||||
if not self.active:
|
||||
return
|
||||
|
||||
if self.lastfailed:
|
||||
previously_failed = []
|
||||
previously_passed = []
|
||||
|
@ -203,9 +205,7 @@ class LFPlugin(object):
|
|||
else: # --failedfirst
|
||||
items[:] = previously_failed + previously_passed
|
||||
|
||||
noun = (
|
||||
"failure" if self._previously_failed_count == 1 else "failures"
|
||||
)
|
||||
noun = "failure" if self._previously_failed_count == 1 else "failures"
|
||||
suffix = " first" if self.config.getoption("failedfirst") else ""
|
||||
self._report_status = "rerun previous {count} {noun}{suffix}".format(
|
||||
count=self._previously_failed_count, suffix=suffix, noun=noun
|
||||
|
|
Loading…
Reference in New Issue