Skip to content

Commit

Permalink
Use assertRegex instead of assertRegexpMatches
Browse files Browse the repository at this point in the history
I get these warnings when running against Python 3.7.4:

    tests/plugins/src.ctf.fs/query/test_query_trace_info.py:192: DeprecationWarning: Please use assertRegex instead.

Change-Id: I77cf2efc7aa74c4e4138e08c3ac1b9e618b718cd
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2215
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
  • Loading branch information
simark committed Oct 18, 2019
1 parent b7d2695 commit 5687169
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/plugins/src.ctf.fs/query/test_query_trace_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ def test_trace_uuid_stream_class_id_no_stream_id(self):
trace = res[0]
streams = sorted(trace["stream-infos"], key=sort_predictably)
self.assertEqual(len(streams), 2)
self.assertRegexpMatches(
self.assertRegex(
str(streams[0]["port-name"]),
r"^7afe8fbe-79b8-4f6a-bbc7-d0c782e7ddaf \| 0 \| .*"
+ re.escape(str(os_stream_path / "test_stream_0"))
+ r"$",
)
self.assertRegexpMatches(
self.assertRegex(
str(streams[1]["port-name"]),
r"^7afe8fbe-79b8-4f6a-bbc7-d0c782e7ddaf \| 0 \| .*"
+ re.escape(str(os_stream_path / "test_stream_1"))
Expand All @@ -185,7 +185,7 @@ def test_trace_uuid_no_stream_class_id_no_stream_id(self):
trace = res[0]
streams = sorted(trace["stream-infos"], key=sort_predictably)
self.assertEqual(len(streams), 1)
self.assertRegexpMatches(
self.assertRegex(
str(streams[0]["port-name"]),
r"^2a6422d0-6cee-11e0-8c08-cb07d7b3a564 \| .*"
+ re.escape(str(os_stream_path))
Expand Down

0 comments on commit 5687169

Please sign in to comment.