tests.test_empty_output.test_empty_output   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_empty_output() 0 14 1
1
import os
2
import subprocess
3
4
5
here = os.path.dirname(os.path.abspath(__file__))
6
7
verbose_file = os.path.join(here, "verbose.py")
8
non_verbose_file = os.path.join(here, "non_verbose.py")
9
10
11
def test_empty_output():
12
    output_verbose = subprocess.run(["python", verbose_file], stdout=subprocess.PIPE)
13
    output_non_verbose = subprocess.run(
14
        ["python", non_verbose_file], stdout=subprocess.PIPE
15
    )
16
17
    verbose_str = output_verbose.stdout.decode()
18
    non_verbose_str = output_non_verbose.stdout.decode()
19
20
    print("\n verbose_str \n", verbose_str, "\n")
21
    print("\n non_verbose_str \n", non_verbose_str, "\n")
22
23
    assert "Results:" in verbose_str
24
    assert not non_verbose_str
25