[test] Explicitly lenght of lxml element
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 20 Feb 2018 10:13:18 +0100
changeset 2947 aa9acf6aa53a
parent 2942 c952e0143549
child 2950 960c8c66cfc2
[test] Explicitly lenght of lxml element Avoids FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
test/test_html_generation.py
--- a/test/test_html_generation.py	Mon Feb 19 16:43:56 2018 +0100
+++ b/test/test_html_generation.py	Tue Feb 20 10:13:18 2018 +0100
@@ -59,7 +59,7 @@
             el_def = {}
             el_defs.append(el_def)
             for span in self.xpath(div, 'span'):
-                if span:
+                if len(span):
                     value = etree.tostring(span[0])
                 else:
                     value = span.text