1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-24 04:24:35 +00:00

fixed python pass handling in cmdline/commands tests so that it works with new w3lib library

This commit is contained in:
Pablo Hoffman 2011-07-14 01:40:31 -03:00
parent dbad1373f1
commit 359129adf9
2 changed files with 5 additions and 7 deletions

View File

@ -3,13 +3,12 @@ import os
from subprocess import Popen, PIPE
import 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):

View File

@ -3,14 +3,12 @@ from __future__ import with_statement
import sys
import os
import subprocess
from os.path import exists, join, dirname, abspath
from os.path import exists, join, abspath
from shutil import rmtree
from tempfile import mkdtemp
from 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)