pytest.raises 3.5.0 breaks for exception classes that look iterable (e.g. spyne.error.RequestNotAllowed) #3372
Labels
type: bug
problem that needs to be addressed
type: regression
indicates a problem that was introduced in a release which was working previously
Hi,
I recently update to pytest 3.5.0 and use it to test applications that use spyne.
Unfortunately, my tests that have code like
now break in the lines starting on
with pytest.raises
and give a traceback similar to this one:The issue didn't come up in previous versions of pytest so I dug a bit and found that
always_iterable
,__len__
and a__getitem__
function,and that this is the cause of these unexpected problems.
I don't know whether exception classes that look iterable are generally disallowed or if this is something that should be supported/fixed in pytest.
I didn't find this behavior change to be mentioned in the changelog but I may have not looked thoroughly enough.
Perhaps you can advise?
Thanks!
Tim
Here is some IPython output from my digging:
always_iterable
attempts to create an iterable by executingI'm using
It works in pytest 3.4.2 where
always_iterable
isn't used in functionraises
of_pytest/python_api.py
.The text was updated successfully, but these errors were encountered: