Test Failed
Push — master ( 112d0a...f337c2 )
by Oliver
02:15
created

conftest   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 11
eloc 59
dl 0
loc 84
rs 10
c 0
b 0
f 0

11 Functions

Rating   Name   Duplication   Size   Complexity  
A politician_fixture() 0 5 1
A name_fixture() 0 5 1
A academic_fixture() 0 5 1
A notinrange_fixture() 0 5 1
A toomanyfirstnames_fixture() 0 5 1
A person_fixture() 0 5 1
A attrdisplay_fixture() 0 5 1
A standardize_name_fixture() 0 5 1
A noble_fixture() 0 5 1
A first_names_fixture() 0 5 1
A mop_fixture() 0 5 1
1
# conftest.py
2
import logging
3
4
import pytest
5
6
LOGGER = logging.getLogger(__name__)
7
8
9
@pytest.fixture(scope="function")
10
def toomanyfirstnames_fixture():
11
    LOGGER.info("Setting Up TooManyFirstNames Fixture ...")
12
    yield
13
    LOGGER.info("Tearing Down TooManyFirstNames Fixture ...")
14
15
16
@pytest.fixture(scope="function")
17
def name_fixture():
18
    LOGGER.info("Setting Up Names Fixture ...")
19
    yield
20
    LOGGER.info("Tearing Down Names Fixture ...")
21
22
23
@pytest.fixture(scope="function")
24
def academic_fixture():
25
    LOGGER.info("Setting Up Academic Fixture ...")
26
    yield
27
    LOGGER.info("Tearing Down Academic Fixture ...")
28
29
30
@pytest.fixture(scope="function")
31
def noble_fixture():
32
    LOGGER.info("Setting Up Noble Fixture ...")
33
    yield
34
    LOGGER.info("Tearing Down Noble Fixture ...")
35
36
37
@pytest.fixture(scope="function")
38
def person_fixture():
39
    LOGGER.info("Setting Up Person Fixture ...")
40
    yield
41
    LOGGER.info("Tearing Down Person Fixture ...")
42
43
44
@pytest.fixture(scope="function")
45
def politician_fixture():
46
    LOGGER.info("Setting Up Politician Fixture ...")
47
    yield
48
    LOGGER.info("Tearing Down Politician Fixture ...")
49
50
51
@pytest.fixture(scope="function")
52
def mop_fixture():
53
    LOGGER.info("Setting Up MoP Fixture ...")
54
    yield
55
    LOGGER.info("Tearing Down MoP Fixture ...")
56
57
58
@pytest.fixture(scope="function")
59
def notinrange_fixture():
60
    LOGGER.info("Setting Up NotInRange Fixture ...")
61
    yield
62
    LOGGER.info("Tearing Down NotInRange Fixture ...")
63
64
65
@pytest.fixture(scope="function")
66
def attrdisplay_fixture():
67
    LOGGER.info("Setting Up AttrDisplay Fixture ...")
68
    yield
69
    LOGGER.info("Tearing Down AttrDisplay Fixture ...")
70
71
72
@pytest.fixture(scope="function")
73
def first_names_fixture():
74
    LOGGER.info("Setting Up FirstNames Fixture ...")
75
    yield
76
    LOGGER.info("Tearing Down FirstNames Fixture ...")
77
78
79
@pytest.fixture(scope="function")
80
def standardize_name_fixture():
81
    LOGGER.info("Setting Up StandardizeName Fixture ...")
82
    yield
83
    LOGGER.info("Tearing Down StandardizeName Fixture ...")
84
85
86
# https://stackoverflow.com/a/51742499/6597765
87
# @pytest.fixture(scope="function")
88
# def cleanup_file_fixture(monkeypatch):
89
#     files = []
90
#     monkeypatch.setattr(builtins, 'open', patch_open(builtins.open, files))
91
#     monkeypatch.setattr(io, 'open', patch_open(io.open, files))
92
#     yield
93
#     for file in files:
94
#         os.remove(file)
95