Passed
Push — master ( 00d837...bc5250 )
by Jace
49s
created

QuietReporter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
wmc 1
1
"""Unit tests configuration file."""
2
3
from unittest.mock import Mock
4
5
import pytest
6
7
from memegen import services
8
from memegen.domain import Template
9
10
11
def pytest_configure(config):
12
    terminal = config.pluginmanager.getplugin('terminal')
13
14
    class QuietReporter(terminal.TerminalReporter):
15
        def __init__(self, *args, **kwargs):
16
            super().__init__(*args, **kwargs)
17
            self.verbosity = 0
18
            self.showlongtestinfo = False
19
            self.showfspath = False
20
21
    terminal.TerminalReporter = QuietReporter
22
23
24
@pytest.fixture
25
def template_service():
26
    return services.template.TemplateService(template_store=Mock())
27
28
29
@pytest.fixture
30
def link_service():
31
    return services.link.LinkService(template_store=Mock())
32
33
34
@pytest.fixture
35
def image_service():
36
    return services.image.ImageService(
37
        template_store=Mock(),
38
        font_store=Mock(),
39
        image_store=Mock(),
40
    )
41
42
43
@pytest.fixture
44
def template():
45
    return Template('abc', name='ABC', lines=['foo', 'bar'])
46