diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txt index 8f5c0de48..5a009db36 100644 --- a/tests/py3-ignores.txt +++ b/tests/py3-ignores.txt @@ -25,8 +25,6 @@ tests/test_mail.py tests/test_pipeline_files.py tests/test_pipeline_images.py tests/test_proxy_connect.py -tests/test_selector_csstranslator.py -tests/test_selector.py tests/test_spidermiddleware_depth.py tests/test_spidermiddleware_httperror.py tests/test_spidermiddleware_offsite.py diff --git a/tests/test_selector.py b/tests/test_selector.py index dc37da86b..4806bb90b 100644 --- a/tests/test_selector.py +++ b/tests/test_selector.py @@ -12,18 +12,16 @@ from lxml import etree class SelectorTestCase(unittest.TestCase): - sscls = Selector - def test_simple_selection(self): """Simple selector tests""" - body = "
" - response = TextResponse(url="http://example.com", body=body) - sel = self.sscls(response) + body = u"" + response = TextResponse(url="http://example.com", body=body, encoding='utf-8') + sel = Selector(response) xl = sel.xpath('//input') self.assertEqual(2, len(xl)) for x in xl: - assert isinstance(x, self.sscls) + assert isinstance(x, Selector) self.assertEqual(sel.xpath('//input').extract(), [x.extract() for x in sel.xpath('//input')]) @@ -41,7 +39,7 @@ class SelectorTestCase(unittest.TestCase): def test_deprecated_root_argument(self): with warnings.catch_warnings(record=True) as w: root = etree.fromstring(u'