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.
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 PackagePep8Test Case(unittest. TestCase) : code(self) :
["pep8" ,
"--repeat" ,
os.path. dirname( softwarecenter. __file_ _)
self.assertEqu al(res, 0)
def test_all_
res = subprocess.call(
])
if __name__ == "__main__":
unittest.main()
===
Feel free to merge either version, as they both fix the test itself.