testenv: Prepend underscor to internal method

Change-Id: I2297f4b44d6f0c88409ab6982de4e3640a6a48b2
This commit is contained in:
Pau Espin 2020-06-15 11:39:41 +02:00
parent c3cf682afd
commit 683d196532
1 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ class TestEnv(log_module.Origin):
self.objects_to_clean_up = None
MainLoop.register_poll_func(self.poll)
if self._test.timeout is not None: # aimed at firing once
MainLoop.register_poll_func(self.timeout_expired, timestep=self._test.timeout)
MainLoop.register_poll_func(self._timeout_expired, timestep=self._test.timeout)
def test(self):
return self._test
@ -122,9 +122,9 @@ class TestEnv(log_module.Origin):
except Exception:
log_module.log_exn()
def timeout_expired(self):
def _timeout_expired(self):
# Avoid timeout being called several times:
MainLoop.unregister_poll_func(self.timeout_expired)
MainLoop.unregister_poll_func(self._timeout_expired)
raise log_module.Error('Test Timeout triggered: %d seconds elapsed' % self._test.elapsed_time())
def poll(self):
@ -146,7 +146,7 @@ class TestEnv(log_module.Origin):
self.objects_cleanup()
self.suite_run.reserved_resources.put_all()
MainLoop.unregister_poll_func(self.poll)
MainLoop.unregister_poll_func(self.timeout_expired)
MainLoop.unregister_poll_func(self._timeout_expired)
self.test_import_modules_cleanup()
self.set_overlay_template_dir(None)