Get more details from PyLint
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
class PyLintAdapter < TestingFrameworkAdapter
|
class PyLintAdapter < TestingFrameworkAdapter
|
||||||
REGEXP = /Your code has been rated at (-?\d+\.?\d*)\/(\d+\.?\d*)/
|
REGEXP = /Your code has been rated at (-?\d+\.?\d*)\/(\d+\.?\d*)/
|
||||||
ASSERTION_ERROR_REGEXP = /^.*?\([^,]*?,\ ([^,]*?),[^,]*?\)\ (.*?)$/
|
ASSERTION_ERROR_REGEXP = /^.*?\.py:(\d+):.*?\([^,]*?,\ ([^,]*?),([^,]*?)\)\ (.*?)$/
|
||||||
|
|
||||||
def self.framework_name
|
def self.framework_name
|
||||||
'PyLint'
|
'PyLint'
|
||||||
@ -21,9 +21,12 @@ class PyLintAdapter < TestingFrameworkAdapter
|
|||||||
begin
|
begin
|
||||||
assertion_error_matches = Timeout.timeout(2.seconds) do
|
assertion_error_matches = Timeout.timeout(2.seconds) do
|
||||||
output[:stdout].scan(ASSERTION_ERROR_REGEXP).map do |match|
|
output[:stdout].scan(ASSERTION_ERROR_REGEXP).map do |match|
|
||||||
test = match.first.strip
|
line_no = match.first.strip
|
||||||
description = match.second.strip
|
test = match.second.strip
|
||||||
{test: test, description: description}
|
# e.g. function name, nil if outside of a function. Not always available
|
||||||
|
context = match.third.strip.presence
|
||||||
|
description = match.fourth.strip
|
||||||
|
{test: test, description: description, context: context, line: line_no}
|
||||||
end || []
|
end || []
|
||||||
end
|
end
|
||||||
rescue Timeout::Error
|
rescue Timeout::Error
|
||||||
|
Reference in New Issue
Block a user