1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-26 06:43:44 +00:00

added scrapy.tests.run module to support running tests with 'python -m scrapy.tests.run' in Python 2.6, since Python 2.6 doesn't allow running packages with -m

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%401049
This commit is contained in:
Pablo Hoffman 2009-04-11 05:01:37 +00:00
parent 7e854af69b
commit 3945c36f30
2 changed files with 16 additions and 13 deletions

View File

@ -3,18 +3,8 @@ scrapy.tests: this package contains all Scrapy unittests
To run all Scrapy unittests type:
python -m scrapy.tests
python -m scrapy.tests.run
Keep in mind that some tests may be skipped if you don't have a MySQL database
up and configured appropriately.
Keep in mind that some tests may be skipped if you don't have some (optional)
modules available like MySQLdb or simplejson.
"""
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)

View File

@ -0,0 +1,13 @@
"""
Module to run Scrapy tests - see scrapy.tests docstring
"""
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)