Code review comment for lp:~mvo/software-center/new-pep8

Revision history for this message
Kiwinote (kiwinote) wrote :

The proposed changes are fine - looking at the totality of the file we could simplify it slightly:
- afaics there is no reason why we should setup the test env - pep8 is a static test
- we can hardcode in the softwarecenter package for simplicity - the only thing we may change in the future is testing the whole source, we presumably won't go back to testing subpackages

A simplified test_pep8.py could eg be this:
===
import os.path
import softwarecenter
import subprocess
import unittest

class PackagePep8TestCase(unittest.TestCase):
    def test_all_code(self):
        res = subprocess.call(
                ["pep8",
                 "--repeat",
                 os.path.dirname(softwarecenter.__file__)
                 ])
        self.assertEqual(res, 0)

if __name__ == "__main__":
    unittest.main()
===

Feel free to merge either version, as they both fix the test itself.

review: Approve

« Back to merge proposal