Closed macisamuele closed 5 years ago
I'm surprised by the AppVeyor failure considering that the equivalent build on my AppVeyor profile was successful: https://ci.appveyor.com/project/macisamuele/bravado-core/builds/25119125/job/jbc8hlx34xtudmia vs https://ci.appveyor.com/project/sjaensch/bravado-core/build/job/2uwq50fg9vc55pg1
I'll try to do some digging to understand if there might be some flakiness
Edit: I did try to reproduce multiple times on a windows machine without any success. As our main supported platform is not windows and I was not able to partially replicate the issue, I've trigger a new build of the same changes an as far as I case see AppVeyor is happy now
The changes in https://github.com/Yelp/bravado-core/commit/9603483c348b9ba00d1288ba88aeef4a62c7e155 introduced
__isinstancecheck__
regression.The following test would fail, while it should pass (as a
Dog
is not aCat
)The regression is caused by the fact that due to the fact that I've adopted slots
hasattr(self, '_model_spec')
would always be returnedTrue
so I updated it totype(self) == ModelMeta
. The interesting point is thattype(self)
is always going to beModelMeta
so there would be a very fast short circuit in the logic. This highlights that we do not have a great coverage of "edge" cases on that but it could have been noticed by observing the coverage drop (v5.12.1 vs v5.13.0).In order to fix the regression we might use two alternative approaches:
__instancecheck__
logic and define more accurate tests coverageI opted for the second solution as it would allow us to save space while keeping an accurate determination of
isinstance
.