tests.conftest.app()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
"""Integration tests configuration file."""
2
3
import pytest
0 ignored issues
show
introduced by
Unable to import 'pytest'
Loading history...
4
5
from memegen.factory import create_app
6
from memegen.settings import get_config
7
8
from memegen.tests.conftest import pytest_configure  # pylint: disable=unused-import
9
10
11
@pytest.yield_fixture(scope='session')
12
def app():
13
    yield create_app(get_config('test'))
14
15
16
@pytest.yield_fixture
17
def client(app):  # pylint: disable=redefined-outer-name
18
    yield app.test_client()
19
20
21
@pytest.yield_fixture
22
def public_client(app):  # pylint: disable=redefined-outer-name
23
    backup = app.config['WATERMARK_OPTIONS']
24
    app.config['WATERMARK_OPTIONS'] = ['memegen.link']
25
26
    yield app.test_client()
27
28
    app.config['WATERMARK_OPTIONS'] = backup
29