Failed Conditions
Pull Request — master (#2076)
by Abdeali
02:11
created

pytest_unconfigure()   B

Complexity

Conditions 5

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 5
dl 0
loc 9
rs 8.5454
1
import os
2
import webbrowser
3
4
5
def pytest_unconfigure(config):
6
    htmlcov_path = os.path.join("htmlcov", "index.html")
7
    if (hasattr(config.option, "cov_report") and
8
            'html' in config.option.cov_report and
9
            os.path.isfile(htmlcov_path)):
10
        try:
11
            webbrowser.open_new_tab(htmlcov_path)
12
        except webbrowser.Error:
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable webbrowser does not seem to be defined.
Loading history...
13
            pass
14