https://prefect.io logo
Title
a

Amit Singh

02/19/2020, 7:37 PM
^^ my code is quite simple, and it is giving the above error on line - print(result)
with raises(signals.SUCCESS) as excinfo:

	result = some_lib.some_function()
	print(result)

assert excinfo.type == signals.SUCCESS
assert excinfo.typename == 'SUCCESS'
c

Chris White

02/19/2020, 7:43 PM
Hi @Amit Singh - are you using
pytest.raises
? I’m not sure what the goal of this code is, but it appears to be testing that a random library function raises a particular Prefect signal
a

Amit Singh

02/19/2020, 7:47 PM
Hi @Chris White yes im using pytest.raises
I got your point though, have to raise a signal from the function being called here something like
raise signals.SUCCESS("Mail successfully sent.")
c

Chris White

02/19/2020, 7:48 PM
yup yup exactly
a

Amit Singh

02/19/2020, 7:48 PM
thanks a lot @Chris White
c

Chris White

02/19/2020, 7:48 PM
anytime!