Scrapy, a fast high-level web crawling & scraping framework for Python.
fixed python pass handling in cmdline/commands tests so that it works with new w3lib library
Pablo Hoffman359129adf9d6
diff --git a/scrapy/tests/test_cmdline/__init__.py b/scrapy/tests/test_cmdline/__init__.pyindex d08f266f1..2fb08e119 100644--- a/scrapy/tests/test_cmdline/__init__.py+++ b/scrapy/tests/test_cmdline/__init__.py@@ -3,13 +3,12 @@ import osfrom subprocess import Popen, PIPEimport unittest-import scrapy-class CmdlineTest(unittest.TestCase):def setUp(self):self.env = os.environ.copy()- self.env['PYTHONPATH'] = os.path.dirname(scrapy.__path__[0])+ if 'PYTHONPATH' in os.environ:+ self.env['PYTHONPATH'] = os.environ['PYTHONPATH']self.env['SCRAPY_SETTINGS_MODULE'] = 'scrapy.tests.test_cmdline.settings'def _execute(self, *new_args, **kwargs):diff --git a/scrapy/tests/test_commands.py b/scrapy/tests/test_commands.pyindex e2b671d19..170030693 100644--- a/scrapy/tests/test_commands.py+++ b/scrapy/tests/test_commands.py@@ -3,14 +3,12 @@ from __future__ import with_statementimport sysimport osimport subprocess-from os.path import exists, join, dirname, abspath+from os.path import exists, join, abspathfrom shutil import rmtreefrom tempfile import mkdtempfrom twisted.trial import unittest-import scrapy-class ProjectTest(unittest.TestCase):project_name = 'testproject'@@ -21,7 +19,8 @@ class ProjectTest(unittest.TestCase):self.proj_path = join(self.temp_path, self.project_name)self.proj_mod_path = join(self.proj_path, self.project_name)self.env = os.environ.copy()- self.env['PYTHONPATH'] = dirname(scrapy.__path__[0])+ if 'PYTHONPATH' in os.environ:+ self.env['PYTHONPATH'] = os.environ['PYTHONPATH']def tearDown(self):rmtree(self.temp_path)