mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-22 21:11:57 +00:00
init
This commit is contained in:
45
tests/conftest.py
Normal file
45
tests/conftest.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2020 Mojib Wali.
|
||||
#
|
||||
# invenio-config-tugraz is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the MIT License; see LICENSE file for more
|
||||
# details.
|
||||
|
||||
"""Pytest configuration.
|
||||
|
||||
See https://pytest-invenio.readthedocs.io/ for documentation on which test
|
||||
fixtures are available.
|
||||
"""
|
||||
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
import pytest
|
||||
from flask import Flask
|
||||
from flask_babelex import Babel
|
||||
|
||||
from invenio_config_tugraz import invenioconfigtugraz
|
||||
from invenio_config_tugraz.views import blueprint
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def celery_config():
|
||||
"""Override pytest-invenio fixture.
|
||||
|
||||
TODO: Remove this fixture if you add Celery support.
|
||||
"""
|
||||
return {}
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def create_app(instance_path):
|
||||
"""Application factory fixture."""
|
||||
def factory(**config):
|
||||
app = Flask('testapp', instance_path=instance_path)
|
||||
app.config.update(**config)
|
||||
Babel(app)
|
||||
invenioconfigtugraz(app)
|
||||
app.register_blueprint(blueprint)
|
||||
return app
|
||||
return factory
|
||||
Reference in New Issue
Block a user