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:
parent
7e854af69b
commit
3945c36f30
@ -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)
|
||||
|
13
scrapy/trunk/scrapy/tests/run.py
Normal file
13
scrapy/trunk/scrapy/tests/run.py
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user