Run pylint over the codebase.
(self)
| 39 | ''' |
| 40 | |
| 41 | def test_pylint(self): |
| 42 | ''' |
| 43 | Run pylint over the codebase. |
| 44 | ''' |
| 45 | # Run Pylint |
| 46 | stream = io.StringIO() |
| 47 | reporter = TextReporter(stream) |
| 48 | pylint.lint.Run(['./Test'], reporter, False) |
| 49 | output = stream.getvalue() |
| 50 | |
| 51 | # Write the Pylint log |
| 52 | with open('pylint.log', 'w', encoding='utf-8') as handle: |
| 53 | handle.write(output) |
| 54 | |
| 55 | # Analyze the results |
| 56 | pattern = re.compile(r'Your code has been rated at (.*?)/10') |
| 57 | match = pattern.search(output) |
| 58 | self.assertIsNotNone(match) |
| 59 | score = float(match.group(1)) |
| 60 | |
| 61 | # This target is currently low but we will increase over time |
| 62 | self.assertGreaterEqual(score, 9.95, 'Found Pylint score regression') |
| 63 | |
| 64 | def test_pycodestyle(self): |
| 65 | ''' |
nothing calls this directly
no outgoing calls
no test coverage detected