Code Duplication    Length = 15-15 lines in 3 locations

tests/helpers.py 3 locations

@@ 92-106 (lines=15) @@
89
90
91
# pylint: disable=unused-argument
92
def e2e(size='small'):
93
    """Handle tokens from requests."""
94
    env_test_size = os.environ.get("KYTOS_TESTS_SIZE", 'small')
95
    env_test_type = os.environ.get("KYTOS_TESTS_TYPE", 'unit')
96
97
    def inner_func(func):
98
99
        @wraps(func)
100
        def wrapper(*args, **kwargs):
101
            if env_test_type == 'e2e' and size == env_test_size:
102
                return func(*args, **kwargs)
103
            return None
104
        return wrapper
105
106
    return inner_func
107
@@ 74-88 (lines=15) @@
71
72
73
# pylint: disable=unused-argument
74
def integration(size='small'):
75
    """Handle tokens from requests."""
76
    env_test_size = os.environ.get("KYTOS_TESTS_SIZE", 'small')
77
    env_test_type = os.environ.get("KYTOS_TESTS_TYPE", 'unit')
78
79
    def inner_func(func):
80
81
        @wraps(func)
82
        def wrapper(*args, **kwargs):
83
            if env_test_type == 'integration' and size == env_test_size:
84
                return func(*args, **kwargs)
85
            return None
86
        return wrapper
87
88
    return inner_func
89
90
91
# pylint: disable=unused-argument
@@ 56-70 (lines=15) @@
53
54
55
# pylint: disable=unused-argument
56
def unit(size='small'):
57
    """Handle tokens from requests."""
58
    env_test_size = os.environ.get("KYTOS_TESTS_SIZE", 'small')
59
    env_test_type = os.environ.get("KYTOS_TESTS_TYPE", 'unit')
60
61
    def inner_func(func):
62
63
        @wraps(func)
64
        def wrapper(*args, **kwargs):
65
            if env_test_type == 'unit' and size == env_test_size:
66
                return func(*args, **kwargs)
67
            return None
68
        return wrapper
69
70
    return inner_func
71
72
73
# pylint: disable=unused-argument