[FIX] test_pylint: pylint error output to failure

Sometimes PyLint itself blows up which fails the test but does not
provide any indication as to why, which is inconvenient.
This commit is contained in:
xmo-odoo
2017-05-19 16:46:42 +02:00
committed by Xavier Morel
parent b6660433c6
commit 05abc1faed
+3 -4
View File
@@ -116,11 +116,10 @@ class TestPyLint(TransactionCase):
]
try:
with open(devnull, 'w') as devnull_file:
process = subprocess.Popen(['pylint'] + options + paths, stdout=subprocess.PIPE, stderr=devnull_file)
process = subprocess.Popen(['pylint'] + options + paths, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except (OSError, IOError):
self._skip_test('pylint executable not found in the path')
else:
out = process.communicate()[0]
out, err = process.communicate()
if process.returncode:
self.fail("\n" + out)
self.fail("\n" + out + "\n" + err)