MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / test_pylint

Method test_pylint

Test/astc_test_python.py:41–62  ·  view source on GitHub ↗

Run pylint over the codebase.

(self)

Source from the content-addressed store, hash-verified

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 '''

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected