Skip to content

Commit 6319193

Browse files
committed
TST: Remove defunct test_nowrite_df
(Supposedly) pandas now returns a copy for `df.values`. `df.to_numpy()` doesn't work either ... 🙄
1 parent 86e0127 commit 6319193

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

backtesting/test/_test.py

-17
Original file line numberDiff line numberDiff line change
@@ -584,23 +584,6 @@ def test_max_tries(self):
584584
**OPT_PARAMS)
585585
self.assertEqual(len(heatmap), 6)
586586

587-
def test_nowrite_df(self):
588-
# Test we don't write into passed data df by default.
589-
# Important for copy-on-write in Backtest.optimize()
590-
df = EURUSD.astype(float)
591-
_ = df.values.ctypes.data # dummy call for the value to stabilize!
592-
mem_addr = df.values.ctypes.data
593-
assert mem_addr == df.values.ctypes.data
594-
595-
class S(SmaCross):
596-
def init(self):
597-
super().init()
598-
assert mem_addr == self.data.df.values.ctypes.data, (mem_addr, self.data.df.values.ctypes.data)
599-
600-
bt = Backtest(df, S)
601-
_ = bt.run()
602-
assert mem_addr == bt._data.values.ctypes.data
603-
604587
def test_multiprocessing_windows_spawn(self):
605588
df = GOOG.iloc[:100]
606589
kw = {'fast': [10]}

0 commit comments

Comments
 (0)