From 64e6d01b9b01972fc41cbb32997b2035d82ed358 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sat, 21 Mar 2020 18:34:36 +0100 Subject: [PATCH] Allow multiline Assertion Errors for python --- app/assets/javascripts/editor/editor.js.erb | 2 +- lib/py_unit_adapter.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 2b0de16a..6be9d5dd 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -440,7 +440,7 @@ configureEditors: function () { let errorMessagesToShow = []; result.error_messages.forEach(function (item) { if (item) { - errorMessagesToShow.push(item) + errorMessagesToShow.push(item.replace(/\n/g, '
')) } }) diff --git a/lib/py_unit_adapter.rb b/lib/py_unit_adapter.rb index 1ff5cd98..7abb3370 100644 --- a/lib/py_unit_adapter.rb +++ b/lib/py_unit_adapter.rb @@ -2,7 +2,8 @@ class PyUnitAdapter < TestingFrameworkAdapter COUNT_REGEXP = /Ran (\d+) test/ FAILURES_REGEXP = /FAILED \(.*failures=(\d+).*\)/ ERRORS_REGEXP = /FAILED \(.*errors=(\d+).*\)/ - ASSERTION_ERROR_REGEXP = /AssertionError:\s(.*)/ + # The regex below also catches new line separators. + ASSERTION_ERROR_REGEXP = /AssertionError:\s(.*)\s\s----------------------------------------------------------------------/s def self.framework_name 'PyUnit'