class CommitLive::Strategies::PythonUnittest

Public Instance Methods

cleanup() click to toggle source
# File lib/commit-live/tests/strategies/python-test.rb, line 52
def cleanup
        if File.exists?('.results.json')
                FileUtils.rm('.results.json')
        end
end
detect() click to toggle source
# File lib/commit-live/tests/strategies/python-test.rb, line 7
def detect
        files.any? {|f| f.match(/.*.py$/) }
end
files() click to toggle source
# File lib/commit-live/tests/strategies/python-test.rb, line 11
def files
        @files ||= Dir.entries('.')
end
print_results() click to toggle source
results() click to toggle source
# File lib/commit-live/tests/strategies/python-test.rb, line 48
def results
        @output ||= Oj.load(File.read('.results.json'), mode: :compat)
end
run(dir) click to toggle source
# File lib/commit-live/tests/strategies/python-test.rb, line 15
def run(dir)
        system("nosetests #{dir} --verbose --with-json --json-file=\"./.results.json\" > /dev/null 2>&1")
end