Coverage for mlos_viz/mlos_viz/tests/test_dabl_plot.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-06 00:35 +0000

1# 

2# Copyright (c) Microsoft Corporation. 

3# Licensed under the MIT License. 

4# 

5""" 

6Unit tests for mlos_viz.dabl.plot. 

7""" 

8 

9import warnings 

10 

11from unittest.mock import patch, Mock 

12 

13from mlos_bench.storage.base_experiment_data import ExperimentData 

14 

15from mlos_viz import dabl 

16 

17from mlos_viz.tests import SEABORN_BOXPLOT_PATCH 

18 

19 

20@patch(SEABORN_BOXPLOT_PATCH, create=True) 

21def test_dabl_plot(mock_boxplot: Mock, exp_data: ExperimentData) -> None: 

22 """Tests plotting via dabl.""" 

23 # For now, just ensure that no errors are thrown. 

24 # TODO: Check that a plot was actually produced matching our specifications. 

25 with warnings.catch_warnings(): 

26 warnings.simplefilter("error") 

27 dabl.ignore_plotter_warnings() 

28 dabl.plot(exp_data) 

29 assert mock_boxplot.call_count >= 1