summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Marek <shlomme@gmail.com>2014-04-17 19:14:43 +0200
committerTorsten Marek <shlomme@gmail.com>2014-04-17 19:14:43 +0200
commitec76d962a282fdc68045ef81f9c6602d7734e436 (patch)
tree13534ae9933808813548271f25c656defc0d0a8f
parentccd6318a50e7428dfeb7da74f19a332b71ba5c9c (diff)
downloadpylint-ec76d962a282fdc68045ef81f9c6602d7734e436.tar.gz
Do not crash in update mode if a file does not exist.
-rw-r--r--testutils.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/testutils.py b/testutils.py
index d60ab46..8c01ee6 100644
--- a/testutils.py
+++ b/testutils.py
@@ -312,9 +312,11 @@ class LintTestUpdate(LintTestUsingModule):
def _check_result(self, got):
if self._has_output():
- if got != self._get_expected():
- if not self.output:
- self.output = join(self.MSG_DIR, '%s.txt' % (self.module,))
+ try:
+ expected = self._get_expected()
+ except IOError:
+ expected = ''
+ if got != expected:
with open(self.output, 'w') as fobj:
fobj.write(got)