[PATCH] D68988: [LNT] Python 3 support: adapt regex for div by 0 msg

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 07:30:13 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
thopre added a parent revision: D68987: [LNT] Python 3 support: store color value as int.
thopre added a child revision: D68989: [LNT] Python 3 support: don't assume URL params order.

Test server/ui/V4Pages.py checks that the /explode page leads to a
division by zero exception message. However the exception message has
changed between Python 2 and Python 3 so this commit adapts the regex to
catch both texts.


https://reviews.llvm.org/D68988

Files:
  tests/server/ui/V4Pages.py


Index: tests/server/ui/V4Pages.py
===================================================================
--- tests/server/ui/V4Pages.py
+++ tests/server/ui/V4Pages.py
@@ -638,7 +638,8 @@
     check_json(client, '/db_default/v4/nts/graph?switch_min_mean=yes&plot.0=1.3.2&json=true')
     app.testing = False
     error_page = check_html(client, '/explode', expected_code=500)
-    assert "integer division or modulo by zero" in error_page.get_data(as_text=True)
+    assert re.search("division (or modulo )?by zero",
+                     error_page.get_data(as_text=True))
 
     error_page = check_html(client, '/gone', expected_code=404)
     assert "test" in error_page.get_data(as_text=True)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68988.225032.patch
Type: text/x-patch
Size: 693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191015/6b6ebde7/attachment.bin>


More information about the llvm-commits mailing list