Add test to check packages for Python2.6 compatibility, as well as core.

This commit is contained in:
Todd Gamblin 2015-07-13 18:37:48 +00:00
parent 6f8a4318c5
commit 9d1f8f6bfd

View File

@ -56,11 +56,16 @@ def spack_python_files(self):
yield os.path.join(root, filename)
def test_python_versions(self):
def all_package_py_files(self):
for name in spack.db.all_package_names():
yield spack.db.filename_for_package_name(name)
def check_python_versions(self, files):
# dict version -> filename -> reasons
all_issues = {}
for fn in self.spack_python_files():
for fn in files:
with open(fn) as pyfile:
versions = pyqver2.get_versions(pyfile.read())
for ver, reasons in versions.items():
@ -93,3 +98,11 @@ def test_python_versions(self):
print fmt % msg
self.assertTrue(len(all_issues) == 0)
def test_core_module_compatibility(self):
self.check_python_versions(self.spack_python_files())
def test_package_module_compatibility(self):
self.check_python_versions(self.all_package_py_files())