aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fuzzycat/config.py4
-rw-r--r--fuzzycat/matching.py2
-rw-r--r--tests/test_matching.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/fuzzycat/config.py b/fuzzycat/config.py
new file mode 100644
index 0000000..61050d1
--- /dev/null
+++ b/fuzzycat/config.py
@@ -0,0 +1,4 @@
+
+from dynaconf import Dynaconf
+
+settings = Dynaconf(envvar_prefix="FUZZYCAT")
diff --git a/fuzzycat/matching.py b/fuzzycat/matching.py
index 9ccb62b..55a5833 100644
--- a/fuzzycat/matching.py
+++ b/fuzzycat/matching.py
@@ -13,8 +13,8 @@ from fatcat_openapi_client.rest import ApiException
from fuzzycat.entities import entity_from_dict, entity_from_json
from fuzzycat.utils import es_compat_hits_total
+from fuzzycat.config import settings
-settings = Dynaconf(envvar_prefix="FUZZYCAT")
FATCAT_API_URL = settings.get("FATCAT_API_URL", "https://api.fatcat.wiki/v0")
diff --git a/tests/test_matching.py b/tests/test_matching.py
index 7d8b7af..56999e6 100644
--- a/tests/test_matching.py
+++ b/tests/test_matching.py
@@ -1,14 +1,13 @@
from fuzzycat.matching import anything_to_entity, match_release_fuzzy
+from fuzzycat.config import settings
from fatcat_openapi_client import ReleaseEntity
import pytest
import elasticsearch
import logging
-from dynaconf import Dynaconf
logger = logging.getLogger('test_matching')
logger.setLevel(logging.DEBUG)
-settings = Dynaconf(envvar_prefix="FUZZYCAT")
FATCAT_SEARCH_URL = settings.get("FATCAT_SEARCH_URL", "https://search.fatcat.wiki:443")