mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
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 tempfile
|
||||||
import threading
|
import threading
|
||||||
import enum
|
import enum
|
||||||
|
from inspect import currentframe, getframeinfo
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from MAVProxy.modules.lib import mp_util
|
from MAVProxy.modules.lib import mp_util
|
||||||
@ -6417,6 +6418,12 @@ class TestSuite(ABC):
|
|||||||
#################################################
|
#################################################
|
||||||
# UTILITIES
|
# UTILITIES
|
||||||
#################################################
|
#################################################
|
||||||
|
def lineno(self):
|
||||||
|
'''return line number'''
|
||||||
|
frameinfo = getframeinfo(currentframe().f_back)
|
||||||
|
# print(frameinfo.filename, frameinfo.lineno)
|
||||||
|
return frameinfo.lineno
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def longitude_scale(lat):
|
def longitude_scale(lat):
|
||||||
ret = math.cos(lat * (math.radians(1)))
|
ret = math.cos(lat * (math.radians(1)))
|
||||||
|
Loading…
Reference in New Issue
Block a user