From ec8b742a891bcc78d9c8da6062730a66d0610cce Mon Sep 17 00:00:00 2001 From: Scott Mcdermott Date: Tue, 20 Aug 2024 19:00:24 -0700 Subject: [PATCH] Use raw python strings for regex escapes in test summary Python warns about "\d" and friends that aren't in raw quotes, so we add the 'r'aw string-qualifier. Signed-off-by: Scott --- test/summary.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/summary.t b/test/summary.t index 39bd33ee..02d8f54c 100755 --- a/test/summary.t +++ b/test/summary.t @@ -57,7 +57,7 @@ class TestSummary(TestCase): code, out, err = self.t("summary :ids {:%Y-%m-%d} - {:%Y-%m-%d}".format(yesterday, tomorrow)) - self.assertRegex(out, """ + self.assertRegex(out, r""" Wk ?Date Day ID Tags ?Start ?End Time Total [ -]+ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} @1 ?\d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2}( @@ -76,7 +76,7 @@ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} @1 ?\d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2 code, out, err = self.t("summary :ids :all".format(yesterday, tomorrow)) - self.assertRegex(out, """ + self.assertRegex(out, r""" Wk ?Date Day ID Tags ?Start ?End Time Total [ -]+ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} @1 ?\d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2}( @@ -95,7 +95,7 @@ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} @1 ?\d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2 code, out, err = self.t("summary :ids {:%Y-%m-%d} - {:%Y-%m-%d}".format(yesterday, tomorrow)) - self.assertRegex(out, """ + self.assertRegex(out, r""" Wk ?Date Day ID Tags ?Start End Time Total [ -]+ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} @1 ?\d{1,2}:\d{2}:\d{2}[ ]+- \d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2}( @@ -114,7 +114,7 @@ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} @1 ?\d{1,2}:\d{2}:\d{2}[ ]+- \d{1,2}:\d{2} code, out, err = self.t("summary :ids :all".format(yesterday, tomorrow)) - self.assertRegex(out, """ + self.assertRegex(out, r""" Wk ?Date Day ID Tags ?Start End Time Total [ -]+ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} @1 ?\d{1,2}:\d{2}:\d{2}[ ]+- \d{1,2}:\d{2}:\d{2} \d{1,2}:\d{2}:\d{2}( @@ -362,7 +362,7 @@ W10 2017-03-11 Sat @3 FOO 10:00:00 11:00:00 1:00:00 """Summary should display empty intervals at midnight""" self.t("track sod - sod") code, out, err = self.t("summary :year") - self.assertRegex(out, """ + self.assertRegex(out, r""" Wk ?Date Day Tags ?Start ?End Time Total [ -]+ W\d{1,2} \d{4}-\d{2}-\d{2} .{3} ?0:00:00 0:00:00 0:00:00 0:00:00