mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
python: Catch specific exceptions from subprocess.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
aabef3d9be
commit
17ac17286c
@@ -2,6 +2,7 @@ import base64
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import urllib
|
||||
from contextlib import contextmanager
|
||||
@@ -970,7 +971,7 @@ Output:
|
||||
'''
|
||||
with \
|
||||
self.settings(ERROR_BOT=None), \
|
||||
mock.patch('zerver.lib.markdown.timeout', side_effect=KeyError('foo')), \
|
||||
mock.patch('zerver.lib.markdown.timeout', side_effect=subprocess.CalledProcessError(1, [])), \
|
||||
mock.patch('zerver.lib.markdown.markdown_logger'):
|
||||
yield
|
||||
|
||||
|
||||
Reference in New Issue
Block a user