Scrapy, a fast high-level web crawling & scraping framework for Python.
sorted out running of unittests:
pablo7b34e08392b2
diff --git a/bin/runtests.bat b/bin/runtests.batnew file mode 100644index 000000000..8a0869938--- /dev/null+++ b/bin/runtests.bat@@ -0,0 +1,19 @@+@ECHO off++SET test="scrapy"+IF NOT "%1" == "" SET test="%1"++IF EXIST c:\python26\scripts\trial.py GOTO py26+IF EXIST c:\python25\scripts\trial.py GOTO py25++ECHO "Unable to run tests: trial command (included with Twisted) not found"+GOTO end++:py26+c:\python26\scripts\trial.py %test%+GOTO end++:py25+c:\python25\scripts\trial.py %test%++:enddiff --git a/bin/runtests.sh b/bin/runtests.shindex 20a73c45d..b381e29d8 100755--- a/bin/runtests.sh+++ b/bin/runtests.sh@@ -3,10 +3,16 @@# look for twisted trial command in common known locationsif [ -x /usr/bin/trial ]; thentrial="/usr/bin/trial"+elif [ -x /usr/lib/twisted/bin/trial ]; then+ trial="/usr/lib/twisted/bin/trial"elif [ -x /usr/lib64/twisted/bin/trial ]; thentrial="/usr/lib64/twisted/bin/trial"+else+ echo "Unable to run tests: trial command (included with Twisted) not found"+ exit 1fi+# disable custom settings for running tests in a neutral environmentexport SCRAPY_SETTINGS_DISABLED=1diff --git a/scrapy/tests/__init__.py b/scrapy/tests/__init__.pyindex 46c662312..c77772af5 100644--- a/scrapy/tests/__init__.py+++ b/scrapy/tests/__init__.py@@ -1,12 +1,14 @@"""scrapy.tests: this package contains all Scrapy unittests-To run all Scrapy unittests type:+To run all Scrapy unittests go to Scrapy main dir and type:- python -m scrapy.tests.run+ bin/runtests.sh++If you're in windows use runtests.bat instead.Keep in mind that some tests may be skipped if you don't have some (optional)-modules available like MySQLdb or simplejson.+modules available like MySQLdb or simplejson, but that's not a problem."""import osdiff --git a/scrapy/tests/run.py b/scrapy/tests/run.pydeleted file mode 100644index bc58cc747..000000000--- a/scrapy/tests/run.py+++ /dev/null@@ -1,15 +0,0 @@-"""-Module to run Scrapy tests - see scrapy.tests docstring-"""--if __name__ == '__main__':- import os, sys- from twisted.trial import runner, reporter-- tests_to_run = sys.argv[1:] or ['scrapy']-- os.environ['SCRAPY_SETTINGS_DISABLED'] = '1'- loader = runner.TestLoader()- runner = runner.TrialRunner(reporter.TreeReporter)- suite = loader.loadByNames(tests_to_run, recurse=True)- runner.run(suite)