From 9850d1afec3842e0081699417c89ff0dee073c1b Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Mon, 8 Jul 2019 17:59:02 +0200 Subject: [PATCH] Tools: update with flake8 W605 invalid escape sequence '\s' F402 import 'time' from line 10 shadowed by loop variable E101 indentation contains mixed spaces and tabs E703 statement ends with a semicolon --- Tools/autotest/apmrover2.py | 6 +++--- Tools/autotest/arducopter.py | 2 +- Tools/autotest/common.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Tools/autotest/apmrover2.py b/Tools/autotest/apmrover2.py index 943f8e661d..2f7ce57bc3 100644 --- a/Tools/autotest/apmrover2.py +++ b/Tools/autotest/apmrover2.py @@ -1019,7 +1019,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) self.change_mode("RTL") # location copied in from rover-test-rally.txt: loc = mavutil.location(40.071553, - -105.229401, + -105.229401, 0, 0) self.wait_location(loc, accuracy=accuracy) @@ -1720,7 +1720,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) lambda: self.drive_mission("rover1.txt")), # disabled due to frequent failures in travis. This test needs re-writing - # ("Drive Brake", self.drive_brake), + # ("Drive Brake", self.drive_brake), ("GetBanner", "Get Banner", self.do_get_banner), @@ -1812,7 +1812,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) ret = super(AutoTestRover, self).rc_defaults() ret[3] = 1500 ret[8] = 1800 - return ret; + return ret def default_mode(self): return 'MANUAL' diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 5c7e777eaf..f30d3e9c1c 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -1782,7 +1782,7 @@ class AutoTestCopter(AutoTest): self.mavproxy.expect('BANG') self.set_rc(9, 1000) self.reboot_sitl() - self.context_pop(); + self.context_pop() self.progress("Crashing with 3pos switch in disable position") loiter_alt = 10 diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 7efb3acf09..4559bec8fb 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -589,13 +589,13 @@ class AutoTest(ABC): if l1 == l2: # e.g. the first "QGC WPL 110" line continue - if re.match("0\s", l1): + if re.match(r"0\s", l1): # home changes... continue l1 = l1.rstrip() l2 = l2.rstrip() - fields1 = re.split("\s+", l1) - fields2 = re.split("\s+", l2) + fields1 = re.split(r"\s+", l1) + fields2 = re.split(r"\s+", l2) # line = int(fields1[0]) t = int(fields1[3]) # mission item type for (count, (i1, i2)) in enumerate(zip(fields1, fields2)): @@ -1859,10 +1859,10 @@ class AutoTest(ABC): for desc in self.test_timings.keys(): if len(desc) > longest: longest = len(desc) - for desc, time in sorted(self.test_timings.iteritems(), + for desc, test_time in sorted(self.test_timings.iteritems(), key=self.show_test_timings_key_sorter): fmt = "%" + str(longest) + "s: %.2fs" - self.progress(fmt % (desc, time)) + self.progress(fmt % (desc, test_time)) def send_statustext(self, text): if sys.version_info.major >= 3 and not isinstance(text, bytes):