[lxml-dev] Test failures on Windows

Sidnei da Silva sidnei at awkly.org
Fri Oct 27 23:04:54 CEST 2006


On Fri, Oct 27, 2006 at 10:55:11PM +0200, Stefan Behnel wrote:
| Thanks. Most of those are the usual Windows bugs that you can't delete an open
| file. I fixed some and just silenced the remaining two - shouldn't be too much
| of a problem if tiny temporary files are not deleted after running the test
| cases (which is a rare enough event anyway...)

Yeah, as long as they are tiny :) I will be running the tests
constantly on that box. Maybe I can setup some task to clean up $TMP.

| There's one problem left, though, and I don't have any idea where it might
| come from.
| 
| ======================================================================
| FAIL: test_xslt_parameters (lxml.tests.test_xslt.ETreeXSLTTestCase)
| ----------------------------------------------------------------------
| Traceback (most recent call last):
|   File "C:\pybots\slave\trunk.dasilva-x86\build\lib\unittest.py", line 260, in run
|     testMethod()
|   File "C:\pybots\slave\python-tool\lxml-trunk\src\lxml\tests\test_xslt.py",
| line 210, in test_xslt_parameters
|     st.apply, tree)
|   File "C:\pybots\slave\trunk.dasilva-x86\build\lib\unittest.py", line 326, in
| failUnlessRaises
|     raise self.failureException, "%s not raised" % excName
| AssertionError: XSLTApplyError not raised
| ----------------------------------------------------------------------
| 
| Test case being:
| 
| ----------------------------------------------------------------------
|     def test_xslt_parameters(self):
|         tree = self.parse('<a><b>B</b><c>C</c></a>')
|         style = self.parse('''\
| <xsl:stylesheet version="1.0"
|     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|   <xsl:template match="*" />
|   <xsl:template match="/">
|     <foo><xsl:value-of select="$bar" /></foo>
|   </xsl:template>
| </xsl:stylesheet>''')
| 
|         st = etree.XSLT(style)
|         res = st.apply(tree, bar="'Bar'")
|         self.assertEquals('''\
| <?xml version="1.0"?>
| <foo>Bar</foo>
| ''',
|                           st.tostring(res))
|         # apply without needed parameter will lead to XSLTApplyError
|         self.assertRaises(etree.XSLTApplyError,
|                           st.apply, tree)
| ----------------------------------------------------------------------
| 
| Apparently, the comment is wrong here...
| 
| I'll have to find some time to look into this, unless someone has an idea?
| Could anyone test this under Windows and maybe figure out what happens here?
| Sometimes this means that an unexpected exception is raised instead - or none
| at all?

I can look at that later today.

-- 
Sidnei da Silva
Enfold Systems                http://enfoldsystems.com
Fax +1 832 201 8856     Office +1 713 942 2377 Ext 214


More information about the lxml-dev mailing list