autotest: pass sitl_commandline_customised up the context stack

We're running tests on the Callisto frame when we shouldn't in Copter as
the information was lost in nested Contexts.

We can only reset the SITL commandline at an actual Test level - if a
defaults file has been used then it is unclear as to what the state of
any parameter is in storage as we move between contexts
This commit is contained in:
Peter Barker 2021-05-01 13:49:18 +10:00 committed by Peter Barker
parent 117a44b589
commit 8fdfdebe55
1 changed files with 3 additions and 0 deletions

View File

@ -4155,6 +4155,9 @@ class AutoTest(ABC):
def context_pop(self):
"""Set parameters to origin values in reverse order."""
dead = self.contexts.pop()
if dead.sitl_commandline_customised and len(self.contexts):
self.contexts[-1].sitl_commandline_customised = True
dead_parameters_dict = {}
for p in dead.parameters:
dead_parameters_dict[p[0]] = p[1]