Skip to content

Commit d4e487c

Browse files
committed
add tests for check_plots()
1 parent 99b922e commit d4e487c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

extras/test_autograder_helpers.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pytest
2+
from .autograder.source.tests.helpers import check_plots
3+
4+
5+
def test_check_plots_good():
6+
check_plots('px.line(df, x="year", y="life_expectancy", title="Life expectancy")')
7+
8+
9+
def test_check_plots_get_trendline_results():
10+
check_plots("px.get_trendline_results(fig)")
11+
12+
13+
def test_check_plots_no_plotly():
14+
check_plots("")
15+
16+
17+
def test_check_plots_no_title():
18+
with pytest.raises(AssertionError):
19+
check_plots('px.line(df, x="year", y="life_expectancy")')

0 commit comments

Comments
 (0)