fix unit test and code style changes

This commit is contained in:
peng.xu 2019-10-25 20:39:44 +08:00
parent cf6df18446
commit 2ab0e0eb93
4 changed files with 13 additions and 9 deletions

View File

@ -25,6 +25,7 @@ def app(request):
yield app
db.drop_all()
app.stop()
# shutil.rmtree(tpath)

View File

@ -2,6 +2,7 @@ import os
import logging
from functools import partial
from pluginbase import PluginBase
from tracer import Tracer
logger = logging.getLogger(__name__)
@ -13,14 +14,15 @@ PLUGIN_PACKAGE_NAME = 'tracer.plugins'
plugin_base = PluginBase(package=PLUGIN_PACKAGE_NAME,
searchpath=[get_path('./plugins')])
class TracerFactory(object):
def __init__(self, searchpath=None):
self.plugin_package_name = PLUGIN_PACKAGE_NAME
self.tracer_map = {}
searchpath = searchpath if searchpath else []
searchpath = [searchpath] if isinstance(searchpath, str) else searchpath
self.source = plugin_base.make_plugin_source(
searchpath=searchpath, identifier=self.__class__.__name__)
self.source = plugin_base.make_plugin_source(searchpath=searchpath,
identifier=self.__class__.__name__)
for plugin_name in self.source.list_plugins():
plugin = self.source.load_plugin(plugin_name)

View File

@ -8,6 +8,7 @@ logger = logging.getLogger(__name__)
PLUGIN_NAME = __file__
class JaegerFactory:
name = 'jaeger'
@classmethod