diff options
-rw-r--r-- | lint.py | 2 | ||||
-rw-r--r-- | test/smoketest.py | 11 |
2 files changed, 10 insertions, 3 deletions
@@ -622,7 +622,7 @@ warning, statement which respectively contain the number of errors / warnings\ self._ignore_file = False # fix the current file (if the source file was not available or # if it's actually a c extension) - self.current_file = astroid.file + self.current_file = astroid.file # pylint: disable=maybe-no-member self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers) self._add_suppression_messages() # notify global end diff --git a/test/smoketest.py b/test/smoketest.py index 997d8f5..26e2c9a 100644 --- a/test/smoketest.py +++ b/test/smoketest.py @@ -39,8 +39,15 @@ class RunTC(TestCase): try: Run(args, reporter=reporter) except SystemExit, ex: - msg = 'expected output status %s, got %s. Below pylint output: \n%s' % ( - code, ex.code, out.getvalue()) + if reporter: + output = reporter.out.getvalue() + elif hasattr(out, 'getvalue'): + output = out.getvalue() + else: + output = None + msg = 'expected output status %s, got %s' % (code, ex.code) + if output is not None: + msg = '%s. Below pylint output: \n%s' % (msg, output) self.assertEqual(ex.code, code, msg) else: self.fail('expected system exit') |