提交 b6bc2dae 编写于 作者: C Cleber Rosa

htmlresult plugin: deal with missing requirements at module load time

This is how I believe *plugin* dependencies should be handled. If
something that a plugin requires is not present, it simply fails to
load.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 13a5fbc0
......@@ -45,10 +45,10 @@ from avocado.settings import settings
try:
from avocado.core.plugins import htmlresult
HTML_REPORT_SUPPORT = True
except ImportError:
HTML_REPORT_SUPPORT = False
else:
HTML_REPORT_SUPPORT = htmlresult.HTML_REPORT_CAPABLE
_NEW_ISSUE_LINK = 'https://github.com/avocado-framework/avocado/issues/new'
......
......@@ -20,13 +20,7 @@ import shutil
import sys
import time
import subprocess
try:
import pystache
except ImportError:
HTML_REPORT_CAPABLE = False
else:
HTML_REPORT_CAPABLE = True
import pystache
from avocado import runtime
from avocado.core import exit_codes
......@@ -282,9 +276,6 @@ class HTML(plugin.Plugin):
enabled = True
def configure(self, parser):
if HTML_REPORT_CAPABLE is False:
self.enabled = False
return
self.parser = parser
self.parser.runner.output.add_argument(
'--html', type=str,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册