mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-01 23:24:10 +01:00
Fix tests with Travis.
This commit is contained in:
parent
7a71ecb9f9
commit
d13015dfb5
@ -11,5 +11,5 @@ install:
|
||||
script:
|
||||
- echo $TRAVIS_PYTHON_VERSION
|
||||
- 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
|
||||
|
@ -305,6 +305,7 @@ if __name__ == '__main__':
|
||||
sys.exit(-1)
|
||||
|
||||
conf.allowDefaultOwner = options.allowDefaultOwner
|
||||
conf.disableMultiprocessing = False
|
||||
|
||||
if not os.path.exists(conf.supybot.directories.log()):
|
||||
os.mkdir(conf.supybot.directories.log())
|
||||
|
@ -146,8 +146,13 @@ if __name__ == '__main__':
|
||||
action='append', dest='excludePlugins', default=[],
|
||||
help='List of plugins you do not want --plugins-dir '
|
||||
'to include.')
|
||||
parser.add_option('', '--disable-multiprocessing', action='store_true',
|
||||
dest='disableMultiprocessing',
|
||||
help='Disables multiprocessing stuff.')
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
conf.disableMultiprocessing = options.disableMultiprocessing
|
||||
|
||||
# This must go before checking for args, of course.
|
||||
for pluginDir in options.pluginsDirs:
|
||||
for name in glob.glob(os.path.join(pluginDir, '*')):
|
||||
|
@ -84,6 +84,14 @@ def process(f, *args, **kwargs):
|
||||
<timeout>, if supplied, limits the length of execution of target
|
||||
function to <timeout> seconds."""
|
||||
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()
|
||||
def newf(f, q, *args, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user