pytest_configure()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 17
rs 9.4285

1 Method

Rating   Name   Duplication   Size   Complexity  
A QuietReporter.__init__() 0 5 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(level=logging.DEBUG)
9
10
    terminal = config.pluginmanager.getplugin('terminal')
11
    base = terminal.TerminalReporter
12
13
    class QuietReporter(base):
14
        """A py.test reporting that only shows dots when running tests."""
15
16
        def __init__(self, *args, **kwargs):
17
            super().__init__(*args, **kwargs)
18
            self.verbosity = 0
19
            self.showlongtestinfo = False
20
            self.showfspath = False
21
22
    terminal.TerminalReporter = QuietReporter
23