test_empty_output()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nop 0
dl 0
loc 14
rs 9.9
c 0
b 0
f 0
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