From f2b37e87a129d723718d81c558704ab7378ba148 Mon Sep 17 00:00:00 2001 From: Mark Becwar Date: Wed, 2 Sep 2020 19:10:49 -0700 Subject: [PATCH] Issue #779 Fix deprecation warnings (#850) Summary: Resolves https://github.com/facebook/watchman/issues/779 - Updates strings in several test files to properly escape backslashes. Pull Request resolved: https://github.com/facebook/watchman/pull/850 Reviewed By: chadaustin Differential Revision: D23249109 Pulled By: wez fbshipit-source-id: 4c1a9fe13e7de6f2c19eef9bac17ee6847568bbf --- tests/integration/test_clock.py | 6 +++--- tests/integration/test_fields.py | 2 +- tests/integration/test_request_id.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/test_clock.py b/tests/integration/test_clock.py index 2f831ee021fb..2a5255a75e8e 100644 --- a/tests/integration/test_clock.py +++ b/tests/integration/test_clock.py @@ -15,15 +15,15 @@ def test_clock(self): self.watchmanCommand("watch", root) clock = self.watchmanCommand("clock", root) - self.assertRegex(clock["clock"], "^c:\d+:\d+:\d+:\d+$") + self.assertRegex(clock["clock"], "^c:\\d+:\\d+:\\d+:\\d+$") def test_clock_sync(self): root = self.mkdtemp() self.watchmanCommand("watch", root) clock1 = self.watchmanCommand("clock", root, {"sync_timeout": 100}) - self.assertRegex(clock1["clock"], "^c:\d+:\d+:\d+:\d+$") + self.assertRegex(clock1["clock"], "^c:\\d+:\\d+:\\d+:\\d+$") clock2 = self.watchmanCommand("clock", root, {"sync_timeout": 100}) - self.assertRegex(clock2["clock"], "^c:\d+:\d+:\d+:\d+$") + self.assertRegex(clock2["clock"], "^c:\\d+:\\d+:\\d+:\\d+$") self.assertNotEqual(clock1, clock2) diff --git a/tests/integration/test_fields.py b/tests/integration/test_fields.py index b7bb2e02bf3e..5ec5dbbf8113 100644 --- a/tests/integration/test_fields.py +++ b/tests/integration/test_fields.py @@ -79,4 +79,4 @@ def test_fields(self): self.assertEqual(ns // 1000, us) for field in ["cclock", "oclock"]: - self.assertRegex(file[field], "^c:\d+:\d+:\d+:\d+$") + self.assertRegex(file[field], "^c:\\d+:\\d+:\\d+:\\d+$") diff --git a/tests/integration/test_request_id.py b/tests/integration/test_request_id.py index f92f4ef640e2..56db1ce5147d 100644 --- a/tests/integration/test_request_id.py +++ b/tests/integration/test_request_id.py @@ -50,7 +50,7 @@ def test_queryRequestId(self): request_id = "f13bd3bc02c27afe2413932c6fa6c4942b0574b3" params = {"since": "c:0:0", "request_id": request_id} self.watchmanCommand("query", root, params) - pat = re.compile(".* \[client=.*\] request_id = %s" % request_id) + pat = re.compile(".* \\[client=.*\\] request_id = %s" % request_id) self.assertWaitFor( lambda: any(pat.match(l) for l in self.getServerLogContents()),