Test Failed
Pull Request — master (#48)
by Jan
03:24
created

tests.conftest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 58.33%

Importance

Changes 0
Metric Value
wmc 3
eloc 13
dl 0
loc 17
ccs 7
cts 12
cp 0.5833
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A remove_generated_file() 0 8 3
1 1
import os
2 1
import tempfile
3 1
from glob import glob
4 1
from pathlib import Path
5
6 1
import pytest
7
8
9 1
@pytest.fixture()
10 1
def remove_generated_file():
11
    # Removes all files in /tmp which name starts with oscap-report-tests_*
12
    yield
13
    pattern = str(Path(tempfile.gettempdir()) / "oscap-report-tests_*")
14
    for item in glob(pattern):
15
        if not os.path.isdir(item):
16
            os.remove(item)
17