def test_decorator_called_at_odd_sec():
    """
    Test to check the decorator changed function to be called at odd seconds only
    """
    for _ in range(1000):
        result = session9.add(1)

    assert result != 1000, "add is not only called at odd seconds"
Пример #2
0
def test_odd_secs():
    if (datetime.now().time().second % 2) == 1:
        assert add(1, 2) == 3, "func add not working in odd seconds"
Пример #3
0
def test_for_odd_even_time_func():
    try:
        assert (session9.add(1, 2, 3, 6, 6) == 18), 'Your function not working'
    except TypeError:
        print('Type Error')
Пример #4
0
def test_add_function():
    result = session9.add(1, 2)

    assert result == 3, 'Check for addition returning exact result'