From 70ee66ba0c9599a684d2e57ffbbec7c9f472dfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Wed, 30 Jul 2014 19:41:12 -0300 Subject: [PATCH] Collect the list of packages not working on python3 --- .travis.yml | 3 -- conftest.py | 5 ++- pytest.ini | 2 -- tests/py3-ignores.txt | 83 +++++++++++++++++++++++++++++++++++++++++++ tests/spiders.py | 2 +- tox.ini | 4 +++ 6 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 tests/py3-ignores.txt diff --git a/.travis.yml b/.travis.yml index fe6adc4bc42..b30d13bed94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,6 @@ env: - TOXENV=py27 - TOXENV=precise - TOXENV=py33 -matrix: - allow_failures: - - env: TOXENV=py33 install: - "./.travis-workarounds.sh" - pip install -U tox diff --git a/conftest.py b/conftest.py index 1d47c20dc9e..76461a45abb 100644 --- a/conftest.py +++ b/conftest.py @@ -1,4 +1,4 @@ - +import six import pytest from twisted.python import log @@ -8,6 +8,9 @@ if 'django' not in optional_features: collect_ignore.append("tests/test_djangoitem/models.py") +if six.PY3: + for fn in open('tests/py3-ignores.txt'): + collect_ignore.append(fn.strip()) class LogObservers: """Class for keeping track of log observers across test modules""" diff --git a/pytest.ini b/pytest.ini index b568820c9ca..355ee31c3ae 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,7 +1,5 @@ - [pytest] usefixtures = chdir setlog python_files=test_*.py __init__.py addopts = --doctest-modules --assert=plain twisted = 1 - diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txt new file mode 100644 index 00000000000..17970fe4af8 --- /dev/null +++ b/tests/py3-ignores.txt @@ -0,0 +1,83 @@ +tests/test_closespider.py +tests/test_cmdline/__init__.py +tests/test_command_fetch.py +tests/test_command_shell.py +tests/test_commands.py +tests/test_command_version.py +tests/test_contracts.py +tests/test_contrib_exporter.py +tests/test_contrib_feedexport.py +tests/test_contrib_linkextractors.py +tests/test_contrib_loader.py +tests/test_crawl.py +tests/test_djangoitem/__init__.py +tests/test_downloader_handlers.py +tests/test_downloadermiddleware_ajaxcrawlable.py +tests/test_downloadermiddleware_cookies.py +tests/test_downloadermiddleware_decompression.py +tests/test_downloadermiddleware_defaultheaders.py +tests/test_downloadermiddleware_downloadtimeout.py +tests/test_downloadermiddleware_httpauth.py +tests/test_downloadermiddleware_httpcache.py +tests/test_downloadermiddleware_httpcompression.py +tests/test_downloadermiddleware_httpproxy.py +tests/test_downloadermiddleware.py +tests/test_downloadermiddleware_redirect.py +tests/test_downloadermiddleware_retry.py +tests/test_downloadermiddleware_robotstxt.py +tests/test_downloadermiddleware_stats.py +tests/test_downloadermiddleware_useragent.py +tests/test_dupefilter.py +tests/test_engine.py +tests/test_http_cookies.py +tests/test_http_headers.py +tests/test_http_request.py +tests/test_http_response.py +tests/test_link.py +tests/test_logformatter.py +tests/test_log.py +tests/test_mail.py +tests/test_middleware.py +tests/test_pipeline_files.py +tests/test_pipeline_images.py +tests/test_pipeline_media.py +tests/test_proxy_connect.py +tests/test_responsetypes.py +tests/test_selector_csstranslator.py +tests/test_selector_lxmldocument.py +tests/test_selector.py +tests/test_settings/__init__.py +tests/test_spidermanager/__init__.py +tests/test_spidermanager/test_spiders/__init__.py +tests/test_spidermanager/test_spiders/spider0.py +tests/test_spidermanager/test_spiders/spider1.py +tests/test_spidermanager/test_spiders/spider2.py +tests/test_spidermanager/test_spiders/spider3.py +tests/test_spidermanager/test_spiders/spider4.py +tests/test_spidermiddleware_depth.py +tests/test_spidermiddleware_httperror.py +tests/test_spidermiddleware_offsite.py +tests/test_spidermiddleware_referer.py +tests/test_spidermiddleware_urllength.py +tests/test_spider.py +tests/test_squeue.py +tests/test_stats.py +tests/test_toplevel.py +tests/test_utils_conf.py +tests/test_utils_defer.py +tests/test_utils_gz.py +tests/test_utils_httpobj.py +tests/test_utils_iterators.py +tests/test_utils_jsonrpc.py +tests/test_utils_misc/__init__.py +tests/test_utils_python.py +tests/test_utils_reqser.py +tests/test_utils_request.py +tests/test_utils_response.py +tests/test_utils_serialize.py +tests/test_utils_signal.py +tests/test_utils_sitemap.py +tests/test_utils_spider.py +tests/test_utils_template.py +tests/test_utils_url.py +tests/test_webclient.py diff --git a/tests/spiders.py b/tests/spiders.py index 7dc8540d9d6..83d767f5c49 100644 --- a/tests/spiders.py +++ b/tests/spiders.py @@ -3,7 +3,7 @@ """ import time -from urllib import urlencode +from six.moves.urllib.parse import urlencode from scrapy.spider import Spider from scrapy.http import Request diff --git a/tox.ini b/tox.ini index d86f750dd84..6c3ba72b522 100644 --- a/tox.ini +++ b/tox.ini @@ -51,10 +51,14 @@ deps = mock pytest>=2.6.0 pytest-twisted +commands = + py.test {posargs:tests} [testenv:py34] basepython = python3.4 deps = {[testenv:py33]deps} +commands = + py.test {posargs:tests} [testenv:windows] commands =