Completed
Pull Request — master (#1160)
by Mischa
02:07
created

bears.tests.skip_bear_test()   A

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 3
rs 10
1
def generate_skip_test(bear):
2
    """
3
    Creates a skip_test function for a `unittest` module test from a bear.
4
5
    `check_prerequisites` is used to determine a test skip.
6
7
    :param bear: The bear whose prerequisites determine the test skip.
8
    """
9
    def skip_bear_test():
10
        result = bear.check_prerequisites()
11
        return result if isinstance(result, str) else not result
12
13
    return skip_bear_test
14