Browse Source

Tools: autotest:eliminate parameter restore using contexts

mission-4.1.18
Peter Barker 7 years ago committed by Peter Barker
parent
commit
56a4cd43d4
  1. 8
      Tools/autotest/arducopter.py

8
Tools/autotest/arducopter.py

@ -1150,9 +1150,7 @@ class AutoTestCopter(AutoTest):
old_pos = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True) old_pos = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True)
print("old_pos=%s" % str(old_pos)) print("old_pos=%s" % str(old_pos))
old_gps_type = self.get_parameter("GPS_TYPE") self.context_push();
old_ek2_gps_type = self.get_parameter("EK2_GPS_TYPE")
old_serial5_protocol = self.get_parameter("SERIAL5_PROTOCOL")
ex = None ex = None
try: try:
@ -1218,9 +1216,7 @@ class AutoTestCopter(AutoTest):
self.progress("Exception caught") self.progress("Exception caught")
ex = e ex = e
self.set_parameter("GPS_TYPE", old_gps_type) self.context_pop();
self.set_parameter("EK2_GPS_TYPE", old_ek2_gps_type)
self.set_parameter("SERIAL5_PROTOCOL", old_serial5_protocol)
self.set_rc(3, 1000) self.set_rc(3, 1000)
self.reboot_sitl() self.reboot_sitl()

Loading…
Cancel
Save