skip lxml selector tests if lxml is not available. refs #147

This commit is contained in:
Pablo Hoffman 2010-10-25 14:56:33 -02:00
parent a59bfb539d
commit f7283ad18e
1 changed files with 12 additions and 3 deletions

View File

@ -1,16 +1,25 @@
# TODO: we should merge these tests with test_selector_libxml2.py
import re
import unittest
import weakref
from twisted.trial import unittest
from scrapy.http import TextResponse, HtmlResponse, XmlResponse
from scrapy.selector.lxmlsel import XmlXPathSelector, HtmlXPathSelector, \
XPathSelector
nolxml = False
try:
from scrapy.selector.lxmlsel import XmlXPathSelector, HtmlXPathSelector, \
XPathSelector
except ImportError:
nolxml = True
from scrapy.utils.test import libxml2debug
class XPathSelectorTestCase(unittest.TestCase):
if nolxml:
skip = "lxml not available"
@libxml2debug
def test_selector_simple(self):
"""Simple selector tests"""