Remove six.PY* checks

This commit is contained in:
Eugenio Lacuesta 2019-11-03 01:08:08 -03:00
parent 5d8abdde59
commit eaeaa40b99
No known key found for this signature in database
GPG Key ID: DA3EF2D0913E9810
2 changed files with 5 additions and 27 deletions

View File

@ -1,4 +1,3 @@
import six
import pytest
@ -7,12 +6,11 @@ collect_ignore = [
"scrapy/utils/testsite.py",
]
if six.PY3:
for line in open('tests/py3-ignores.txt'):
file_path = line.strip()
if file_path and file_path[0] != '#':
collect_ignore.append(file_path)
# FIXME: fix or delete these tests
for line in open('tests/py3-ignores.txt'):
file_path = line.strip()
if file_path and file_path[0] != '#':
collect_ignore.append(file_path)
@pytest.fixture()

View File

@ -78,26 +78,6 @@ class ParseUrlTestCase(unittest.TestCase):
to_bytes(x) if not isinstance(x, int) else x for x in test)
self.assertEqual(client._parse(url), test, url)
def test_externalUnicodeInterference(self):
"""
L{client._parse} should return C{str} for the scheme, host, and path
elements of its return tuple, even when passed an URL which has
previously been passed to L{urlparse} as a C{unicode} string.
"""
if not six.PY2:
raise unittest.SkipTest(
"Applies only to Py2, as urls can be ONLY unicode on Py3")
badInput = u'http://example.com/path'
goodInput = badInput.encode('ascii')
self._parse(badInput) # cache badInput in urlparse_cached
scheme, netloc, host, port, path = self._parse(goodInput)
self.assertTrue(isinstance(scheme, str))
self.assertTrue(isinstance(netloc, str))
self.assertTrue(isinstance(host, str))
self.assertTrue(isinstance(path, str))
self.assertTrue(isinstance(port, int))
class ScrapyHTTPPageGetterTests(unittest.TestCase):