Browse Source

autotest: remove global variable

... progress is no longer static and hasn't been for years
master
Peter Barker 2 years ago committed by Peter Barker
parent
commit
eb0f932b52
  1. 5
      Tools/autotest/common.py

5
Tools/autotest/common.py

@ -1474,8 +1474,6 @@ class AutoTest(ABC):
build_opts={}): build_opts={}):
self.start_time = time.time() self.start_time = time.time()
global __autotest__ # FIXME; make progress a non-staticmethod
__autotest__ = self
if binary is None: if binary is None:
raise ValueError("Should always have a binary") raise ValueError("Should always have a binary")
@ -1566,8 +1564,7 @@ class AutoTest(ABC):
def progress(self, text, send_statustext=True): def progress(self, text, send_statustext=True):
"""Display autotest progress text.""" """Display autotest progress text."""
global __autotest__ delta_time = time.time() - self.start_time
delta_time = time.time() - __autotest__.start_time
formatted_text = "AT-%06.1f: %s" % (delta_time, text) formatted_text = "AT-%06.1f: %s" % (delta_time, text)
print(formatted_text) print(formatted_text)
if (send_statustext and if (send_statustext and

Loading…
Cancel
Save