mirror of https://github.com/scrapy/scrapy.git
skip lxml selector tests if lxml is not available. refs #147
This commit is contained in:
parent
a59bfb539d
commit
f7283ad18e
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue