mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-02 08:21:08 -05:00
Fix tests with Travis.
This commit is contained in:
parent
7a71ecb9f9
commit
d13015dfb5
@ -11,5 +11,5 @@ install:
|
|||||||
script:
|
script:
|
||||||
- echo $TRAVIS_PYTHON_VERSION
|
- echo $TRAVIS_PYTHON_VERSION
|
||||||
- python setup.py install
|
- python setup.py install
|
||||||
- cd py3k/; supybot-test test --plugins-dir=plugins/ --exclude=plugins/PluginDownloader --exclude=plugins/ShrinkUrl
|
- cd py3k/; supybot-test test --plugins-dir=plugins/ --exclude=plugins/PluginDownloader --exclude=plugins/ShrinkUrl --disable-multiprocessing
|
||||||
- cat test-logs/messages.log
|
- cat test-logs/messages.log
|
||||||
|
@ -305,6 +305,7 @@ if __name__ == '__main__':
|
|||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
conf.allowDefaultOwner = options.allowDefaultOwner
|
conf.allowDefaultOwner = options.allowDefaultOwner
|
||||||
|
conf.disableMultiprocessing = False
|
||||||
|
|
||||||
if not os.path.exists(conf.supybot.directories.log()):
|
if not os.path.exists(conf.supybot.directories.log()):
|
||||||
os.mkdir(conf.supybot.directories.log())
|
os.mkdir(conf.supybot.directories.log())
|
||||||
|
@ -146,8 +146,13 @@ if __name__ == '__main__':
|
|||||||
action='append', dest='excludePlugins', default=[],
|
action='append', dest='excludePlugins', default=[],
|
||||||
help='List of plugins you do not want --plugins-dir '
|
help='List of plugins you do not want --plugins-dir '
|
||||||
'to include.')
|
'to include.')
|
||||||
|
parser.add_option('', '--disable-multiprocessing', action='store_true',
|
||||||
|
dest='disableMultiprocessing',
|
||||||
|
help='Disables multiprocessing stuff.')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
conf.disableMultiprocessing = options.disableMultiprocessing
|
||||||
|
|
||||||
# This must go before checking for args, of course.
|
# This must go before checking for args, of course.
|
||||||
for pluginDir in options.pluginsDirs:
|
for pluginDir in options.pluginsDirs:
|
||||||
for name in glob.glob(os.path.join(pluginDir, '*')):
|
for name in glob.glob(os.path.join(pluginDir, '*')):
|
||||||
|
@ -85,6 +85,14 @@ def process(f, *args, **kwargs):
|
|||||||
function to <timeout> seconds."""
|
function to <timeout> seconds."""
|
||||||
timeout = kwargs.pop('timeout', None)
|
timeout = kwargs.pop('timeout', None)
|
||||||
|
|
||||||
|
if conf.disableMultiprocessing:
|
||||||
|
pn = kwargs.pop('pn', 'Unknown')
|
||||||
|
cn = kwargs.pop('cn', 'unknown')
|
||||||
|
try:
|
||||||
|
return f(*args, **kwargs)
|
||||||
|
except Exception as e:
|
||||||
|
return e
|
||||||
|
|
||||||
q = multiprocessing.Queue()
|
q = multiprocessing.Queue()
|
||||||
def newf(f, q, *args, **kwargs):
|
def newf(f, q, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user