diff --git a/tests/test_selector.py b/tests/test_selector.py index 4806bb90b..2d6d8c439 100644 --- a/tests/test_selector.py +++ b/tests/test_selector.py @@ -1,9 +1,6 @@ -import re import warnings import weakref -import six from twisted.trial import unittest -from scrapy.exceptions import ScrapyDeprecationWarning from scrapy.http import TextResponse, HtmlResponse, XmlResponse from scrapy.selector import Selector from scrapy.selector.lxmlsel import XmlXPathSelector, HtmlXPathSelector, XPathSelector @@ -14,7 +11,7 @@ class SelectorTestCase(unittest.TestCase): def test_simple_selection(self): """Simple selector tests""" - body = u"
" + body = b"" response = TextResponse(url="http://example.com", body=body, encoding='utf-8') sel = Selector(response) @@ -53,7 +50,7 @@ class SelectorTestCase(unittest.TestCase): self.assertIn('Ignoring deprecated `_root` argument', str(w[-1].message)) def test_flavor_detection(self): - text = u'
Hello

Hello
an Jos\xe9 de
', \ + body=b'an Jos\xe9 de
', \ encoding='utf-8') Selector(r1).xpath('//text()').extract() @@ -100,7 +97,7 @@ class SelectorTestCase(unittest.TestCase): class DeprecatedXpathSelectorTest(unittest.TestCase): - text = u'
Hello

Hello