From 4093a4b83e51bb9d0208ddd5406f26ba0ba163ca Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Thu, 5 Mar 2009 11:12:07 +0000 Subject: [PATCH] added support to run scrapy tests with: python -m scrapy.tests --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40970 --- scrapy/trunk/scrapy/tests/__init__.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scrapy/trunk/scrapy/tests/__init__.py b/scrapy/trunk/scrapy/tests/__init__.py index b72b1493f..b69daf737 100644 --- a/scrapy/trunk/scrapy/tests/__init__.py +++ b/scrapy/trunk/scrapy/tests/__init__.py @@ -1 +1,20 @@ -""" """ \ No newline at end of file +""" +scrapy.tests: this package contains all Scrapy unittests + +To run all Scrapy unittests type: + + python -m scrapy.tests + +Keep in mind that some tests may be skipped if you don't have a MySQL database +up and configured appropriately. +""" + +if __name__ == '__main__': + import os + from twisted.trial import runner, reporter + + os.environ['SCRAPY_SETTINGS_DISABLED'] = '1' + loader = runner.TestLoader() + runner = runner.TrialRunner(reporter.TreeReporter) + suite = loader.loadByNames(['scrapy'], recurse=True) + runner.run(suite)