Completed
Pull Request — develop (#46)
by Jace
01:26
created

describe_detected()   A

Complexity

Conditions 3

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 15
rs 9.4285
1
# pylint: disable=missing-docstring,unused-variable,unused-argument,expression-not-assigned,singleton-comparison
2
3
from expecter import expect
4
5
from coveragespace import services
6
7
8
def describe_detected():
9
10
    def when_off_ci(monkeypatch):
11
        monkeypatch.delenv('APPVEYOR', raising=False)
12
        monkeypatch.delenv('CI', raising=False)
13
        monkeypatch.delenv('CONTINUOUS_INTEGRATION', raising=False)
14
        monkeypatch.delenv('TRAVIS', raising=False)
15
        monkeypatch.delenv('DISABLE_COVERAGE', raising=False)
16
17
        expect(services.detected()) == False
18
19
    def when_on_ci(monkeypatch):
20
        monkeypatch.setenv('TRAVIS', 'true')
21
22
        expect(services.detected()) == True
23