From f79709ea534fefef6b80875193a9fbff80b18387 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 18 Jan 2013 23:04:53 -0800 Subject: [PATCH] test_security_set: detect missing xml support --- pym/portage/tests/glsa/test_security_set.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pym/portage/tests/glsa/test_security_set.py b/pym/portage/tests/glsa/test_security_set.py index 7b209f429..edf567809 100644 --- a/pym/portage/tests/glsa/test_security_set.py +++ b/pym/portage/tests/glsa/test_security_set.py @@ -58,8 +58,21 @@ class SecuritySetTestCase(TestCase): """ + def _must_skip(self): + try: + __import__("xml.etree.ElementTree") + __import__("xml.parsers.expat").parsers.expat.ExpatError + except (AttributeError, ImportError): + return "python is missing xml support" + def testSecuritySet(self): + skip_reason = self._must_skip() + if skip_reason: + self.portage_skip = skip_reason + self.assertFalse(True, skip_reason) + return + ebuilds = { "cat/A-vulnerable-2.2": { "KEYWORDS": "x86" -- 2.26.2