Skip to content

Commit 78dbba7

Browse files
committed
make tests stronger
1 parent a1123a6 commit 78dbba7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/test_fitrecipe.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,14 @@ def test_plot_recipe_on_existing_plot():
423423
optimize_recipe(recipe)
424424
plt.close("all")
425425
fig, ax = plt.subplots()
426-
expected_title = "User Title"
427-
actual_title = ax.set_title(expected_title)
426+
ax.set_title("User Title")
427+
ax.plot([0, 1], [0, 1], label="New Data")
428428
recipe.plot_recipe(ax=ax, show=False)
429+
actual_title = ax.get_title()
430+
expected_title = "User Title"
429431
assert actual_title == expected_title
432+
labels = [label.get_label() for label in ax.get_lines()]
433+
assert "New Data" in labels
430434

431435

432436
def test_plot_recipe_add_new_data():
@@ -474,7 +478,7 @@ def test_plot_recipe_add_new_data_two_figs():
474478
["Observed", "Calculated", "Difference", "New Data"]
475479
)
476480
assert actual_labels == expected_labels
477-
assert len(new_figs) == 1
481+
assert len(new_figs) == 2
478482

479483

480484
def test_plot_recipe_set_title():

0 commit comments

Comments
 (0)