MCPcopy Create free account
hub / github.com/kernc/backtesting.py / test_patch

Method test_patch

backtesting/test/_test.py:1005–1012  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1003 self.assertEqual(_as_str(_Array([1], name=s)), s[0])
1004
1005 def test_patch(self):
1006 class Object:
1007 pass
1008 o = Object()
1009 o.attr = False
1010 with patch(o, 'attr', True):
1011 self.assertTrue(o.attr)
1012 self.assertFalse(o.attr)
1013
1014 def test_pandas_accessors(self):
1015 class S(Strategy):

Callers

nothing calls this directly

Calls 2

patchFunction · 0.90
ObjectClass · 0.85

Tested by

no test coverage detected