tests.conftest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

3 Functions

Rating   Name   Duplication   Size   Complexity  
A app() 0 3 1
A public_client() 0 8 1
A client() 0 3 1
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