Completed
Push — develop ( 9c9256...041c3e )
by Jace
9s
created

QuietReporter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
rs 10
wmc 1
1
"""Unit tests configuration file."""
2
3
import logging
4
5
6
def pytest_configure(config):
7
    """Disable verbose output when running tests."""
8
    logging.basicConfig(
9
        level=logging.DEBUG,
10
        format="%(levelname)s: %(name)s: %(message)s",
11
    )
12
13
    terminal = config.pluginmanager.getplugin('terminal')
14
    base = terminal.TerminalReporter
15
16
    class QuietReporter(base):
17
        """A py.test reporting that only shows dots when running tests."""
18
19
        def __init__(self, *args, **kwargs):
20
            base.__init__(self, *args, **kwargs)
21
            self.verbosity = 0
22
            self.showlongtestinfo = False
23
            self.showfspath = False
24
25
    terminal.TerminalReporter = QuietReporter
26