Fixtures 2.0 is overly strict on monkeypatch requirements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Fixtures |
Fix Released
|
Undecided
|
Andrew Laski |
Bug Description
Fixtures 2.0 added some better handling of staticmethods in MonkeyPatch, but unintentionally caused a constraint that bound methods of a class be patched with similarly bound methods of that class. This is due to checking the wrong attribute for staticness when doing the patching. As a result workarounds like the following are required:
diff --git a/nova/
index 58ef19e..f72e4e6 100644
--- a/nova/
+++ b/nova/
@@ -584,14 +584,19 @@ class StableObjectJso
def setUp(self):
- def _doit(obj, *args, **kwargs):
+ def _obj_to_
result = self._original_
if 'nova_object.
return result
+ # NOTE(alaski): This makes _obj_to_prim_sorter into an instancemethod
+ # so that its signature matches the method it's patching
+ obj_base.
+
- 'nova.objects.
+ 'nova.objects.
+ obj_base.
class EngineFacadeFix
I don't think it's desirable that the requirements be that strict.
https:/ /github. com/testing- cabal/fixtures/ pull/26