You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the problem is that the S(...).extend returns Schema, not S, which breaks pytest integration after using extend.
If Schema.extend behaved more like a @classmethod and returned an instance of type(self), this use case would just work.
The text was updated successfully, but these errors were encountered:
This updates the extend method to return the same type in case
a subclass of Schema has been constructed.
This is a change related to issue alecthomas#370.
The pytest-voluptuous integration package makes use of a
Schema
subclass (S
) to implement concise pytest assertion syntax.It looks like this:
But the problem is that the
S(...).extend
returnsSchema
, notS
, which breaks pytest integration after usingextend
.If
Schema.extend
behaved more like a@classmethod
and returned an instance oftype(self)
, this use case would just work.The text was updated successfully, but these errors were encountered: