From 56a4cd43d48b922a707c3a2d4c0bb64fe162a754 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 30 Jul 2018 17:23:14 +1000 Subject: [PATCH] Tools: autotest:eliminate parameter restore using contexts --- Tools/autotest/arducopter.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 9793e4bc9a..b9f0ac5219 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -1150,9 +1150,7 @@ class AutoTestCopter(AutoTest): old_pos = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True) print("old_pos=%s" % str(old_pos)) - old_gps_type = self.get_parameter("GPS_TYPE") - old_ek2_gps_type = self.get_parameter("EK2_GPS_TYPE") - old_serial5_protocol = self.get_parameter("SERIAL5_PROTOCOL") + self.context_push(); ex = None try: @@ -1218,9 +1216,7 @@ class AutoTestCopter(AutoTest): self.progress("Exception caught") ex = e - self.set_parameter("GPS_TYPE", old_gps_type) - self.set_parameter("EK2_GPS_TYPE", old_ek2_gps_type) - self.set_parameter("SERIAL5_PROTOCOL", old_serial5_protocol) + self.context_pop(); self.set_rc(3, 1000) self.reboot_sitl()