mirror of https://github.com/ArduPilot/ardupilot
autotest: add a lineno method
allows for debug like this: print(f"{self.lineno()} {self.mav.message_hooks=}")
This commit is contained in:
parent
2a964c44d4
commit
7cf96fb0a1
|
@ -34,6 +34,7 @@ import random
|
|||
import tempfile
|
||||
import threading
|
||||
import enum
|
||||
from inspect import currentframe, getframeinfo
|
||||
from pathlib import Path
|
||||
|
||||
from MAVProxy.modules.lib import mp_util
|
||||
|
@ -6417,6 +6418,12 @@ class TestSuite(ABC):
|
|||
#################################################
|
||||
# UTILITIES
|
||||
#################################################
|
||||
def lineno(self):
|
||||
'''return line number'''
|
||||
frameinfo = getframeinfo(currentframe().f_back)
|
||||
# print(frameinfo.filename, frameinfo.lineno)
|
||||
return frameinfo.lineno
|
||||
|
||||
@staticmethod
|
||||
def longitude_scale(lat):
|
||||
ret = math.cos(lat * (math.radians(1)))
|
||||
|
|
Loading…
Reference in New Issue