summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2012-12-30 06:29:49 -0800
committerEli Bendersky <eliben@gmail.com>2012-12-30 06:29:49 -0800
commitd7e2666449b7ab3a8f1d5042c4486d693f81deb0 (patch)
treea1fba55b02383db842d1db3cd44d8b8228b22a35
parent2c53a78a99d9b465276527ae27a6d7abfad4bfdb (diff)
parent52280c427af94d53f1f8278807b2cc106b92f068 (diff)
downloadcpython-git-d7e2666449b7ab3a8f1d5042c4486d693f81deb0.tar.gz
Skip a test correctly for the C-version. The decorator doesn't really work
because it evaluates its condition before pyET is even set by test_main. Therefore, the check it moved to "runtime".
-rw-r--r--Lib/test/test_xml_etree.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index ce6bdc6d8b..2bbf513e9f 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -2420,8 +2420,11 @@ class KeywordArgsTest(unittest.TestCase):
# --------------------------------------------------------------------
-@unittest.skipUnless(pyET, 'only for the Python version')
class NoAcceleratorTest(unittest.TestCase):
+ def setUp(self):
+ if not pyET:
+ raise SkipTest('only for the Python version')
+
# Test that the C accelerator was not imported for pyET
def test_correct_import_pyET(self):
self.assertEqual(pyET.Element.__module__, 'xml.etree.ElementTree')