From 8fe6ac59d500e51168f8284044d3e230c15a1063 Mon Sep 17 00:00:00 2001
From: Martyn Gigg <martyn.gigg@gmail.com>
Date: Tue, 16 Jan 2018 15:08:43 +0000
Subject: [PATCH] Fix errorformatter test for Python 2/3 compatability.

Refs #21251
---
 .../mantidqt/widgets/codeeditor/test/test_errorformatter.py   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qt/python/mantidqt/widgets/codeeditor/test/test_errorformatter.py b/qt/python/mantidqt/widgets/codeeditor/test/test_errorformatter.py
index 82f78a123fe..994aa24d0ad 100644
--- a/qt/python/mantidqt/widgets/codeeditor/test/test_errorformatter.py
+++ b/qt/python/mantidqt/widgets/codeeditor/test/test_errorformatter.py
@@ -62,8 +62,10 @@ foo()
 
         # stacktrace will contain file names that are not portable so don't do equality check
         error_lines = error.splitlines()
+        # python 3 has a slightly different format of the exception error so just check it looks
+        # approximate correct
         expected_lines = [
-            "NameError: global name '_local' is not defined",
+            "NameError:.*'_local'.*",
             '  File ".*test_errorformatter.py", line 56, in test_standard_exception',
             '    exec(.*)',
             '  File "<string>", line 8, in <module>',
-- 
GitLab