1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-12-21 20:48:14 +00:00

use default strict for extension tests

This commit is contained in:
J. Fernando Sánchez 2023-09-26 19:47:23 +02:00
parent e324c730e2
commit b33a70620b
2 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@ It orchestrates plugin (de)activation and analysis.
from future import standard_library from future import standard_library
standard_library.install_aliases() standard_library.install_aliases()
from . import config
from . import plugins, api from . import plugins, api
from .models import Error, AggregatedEvaluation from .models import Error, AggregatedEvaluation
from .plugins import AnalysisPlugin from .plugins import AnalysisPlugin
@ -45,9 +46,10 @@ class Senpy(object):
plugin_folder=".", plugin_folder=".",
data_folder=None, data_folder=None,
install=False, install=False,
strict=True, strict=None,
default_plugins=False): default_plugins=False):
default_data = os.path.join(os.getcwd(), 'senpy_data') default_data = os.path.join(os.getcwd(), 'senpy_data')
self.data_folder = data_folder or os.environ.get('SENPY_DATA', default_data) self.data_folder = data_folder or os.environ.get('SENPY_DATA', default_data)
try: try:
@ -59,7 +61,7 @@ class Senpy(object):
raise raise
self._default = None self._default = None
self.strict = strict self.strict = strict if strict is not None else config.strict
self.install = install self.install = install
self._plugins = {} self._plugins = {}
if plugin_folder: if plugin_folder:

View File

@ -22,9 +22,8 @@ import logging
from functools import partial from functools import partial
from senpy.extensions import Senpy from senpy.extensions import Senpy
from senpy import plugins from senpy import plugins, config, api
from senpy.models import Error, Results, Entry, EmotionSet, Emotion, Plugin from senpy.models import Error, Results, Entry, EmotionSet, Emotion, Plugin
from senpy import api
from flask import Flask from flask import Flask
from unittest import TestCase from unittest import TestCase
@ -260,4 +259,4 @@ class ExtensionsTest(TestCase):
'''The default set of plugins should all load''' '''The default set of plugins should all load'''
self.app = Flask('test_extensions') self.app = Flask('test_extensions')
self.examples_dir = os.path.join(os.path.dirname(__file__), '..', 'example-plugins') self.examples_dir = os.path.join(os.path.dirname(__file__), '..', 'example-plugins')
self.senpy = Senpy(app=self.app, default_plugins=False, strict=True) self.senpy = Senpy(app=self.app, default_plugins=False)