| 670 | self.assertLess(os.path.getsize(f), 500000) |
| 671 | |
| 672 | def test_params(self): |
| 673 | bt = Backtest(GOOG.iloc[:100], SmaCross) |
| 674 | bt.run() |
| 675 | with _tempfile() as f: |
| 676 | for p in dict(plot_volume=False, # noqa: C408 |
| 677 | plot_equity=False, |
| 678 | plot_return=True, |
| 679 | plot_pl=False, |
| 680 | plot_drawdown=True, |
| 681 | plot_trades=False, |
| 682 | superimpose=False, |
| 683 | resample='1W', |
| 684 | smooth_equity=False, |
| 685 | relative_equity=False, |
| 686 | reverse_indicators=True, |
| 687 | show_legend=False).items(): |
| 688 | with self.subTest(param=p[0]): |
| 689 | bt.plot(**dict([p]), filename=f, open_browser=False) |
| 690 | |
| 691 | def test_hide_legend(self): |
| 692 | bt = Backtest(GOOG.iloc[:100], SmaCross) |