From 74b33492cb58a25c2efca4fff1f4a9c52c14dd4c Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Tue, 14 Jun 2016 10:42:15 +0200 Subject: [PATCH] fixed python failure regex. --- lib/py_unit_adapter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/py_unit_adapter.rb b/lib/py_unit_adapter.rb index 23b86ae9..11b8cb09 100644 --- a/lib/py_unit_adapter.rb +++ b/lib/py_unit_adapter.rb @@ -1,6 +1,6 @@ class PyUnitAdapter < TestingFrameworkAdapter COUNT_REGEXP = /Ran (\d+) test/ - FAILURES_REGEXP = /FAILED \((failures)|(errors)=(\d+)\)/ + FAILURES_REGEXP = /FAILED \((failures|errors)=(\d+)\)/ ASSERTION_ERROR_REGEXP = /AssertionError:\s(.*)/ def self.framework_name @@ -10,7 +10,7 @@ class PyUnitAdapter < TestingFrameworkAdapter def parse_output(output) count = COUNT_REGEXP.match(output[:stderr]).captures.first.to_i matches = FAILURES_REGEXP.match(output[:stderr]) - failed = matches ? matches.captures.try(:third).to_i : 0 + failed = matches ? matches.captures.try(:second).to_i : 0 error_matches = ASSERTION_ERROR_REGEXP.match(output[:stderr]).try(:captures) || [] {count: count, failed: failed, error_messages: error_matches} end