E fixture 'condition' not found

Нужна помощь в работе с pytest. Пытаюсь запустить свой код через pytest (обязательное условие):

import time
from Communication import CommFactory


def test_assert(condition, error_message):
    if not condition:
        print(error_message)
        exit(-1)


if __name__ == "__main__":

    comm_address = "Com4"

    comm = CommFactory().get_comm(comm_address)

    rslt = comm.open(comm_address)
    print(comm_address+ ' is open, please reset device...')
    test_assert(rslt, "Failed to open COM Port")

    comm.clear_input_buffer()

    time.sleep(1)

    reply = comm.read_wait_for_line(["Device is ready...", "Device not found"], timeout=60)
    test_assert(reply is not None, "Did not find any of the allowable replies!\n")
    print("Returned reply: " + str(reply) + "\n")
    print("Test passed!")
    comm.close()

и получаю def test_assert(condition, error_message): E fixture 'condition' not found

Буду признателен за помощь


Ответы (0 шт):