Skip to content

Commit

Permalink
Fix up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
znicholls committed Jan 22, 2024
1 parent 55836b5 commit 7798045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
9 changes: 7 additions & 2 deletions tests/unit/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ def test_lineplot(mock_long_data, mock_seaborn_lineplot, scm_run):
mock_long_data.assert_called_with(time_axis="year")

mock_seaborn_lineplot.assert_called_with(
ci="sd", data=trv, estimator=np.median, hue="scenario", x="time", y="value"
errorbar="sd",
data=trv,
estimator=np.median,
hue="scenario",
x="time",
y="value",
)


Expand All @@ -85,7 +90,7 @@ def test_lineplot_kwargs(mock_long_data, mock_seaborn_lineplot, scm_run):
"x": "x",
"y": "y",
"hue": "hue",
"ci": "ci",
"errorbar": "errorbar",
"estimator": "estimator",
}
trv = "test long_data return value"
Expand Down
7 changes: 0 additions & 7 deletions tests/unit/test_pyam_compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import re
from unittest import mock

import pandas as pd
import pytest
Expand Down Expand Up @@ -28,9 +27,3 @@ def test_to_int_value_error(test_iam_df):

with pytest.raises(ValueError, match=error_msg):
LongDatetimeIamDataFrame(idf)


@mock.patch("scmdata.run.LongDatetimeIamDataFrame", None)
def test_pyam_missing(scm_run):
with pytest.raises(ImportError):
scm_run.to_iamdataframe()
2 changes: 1 addition & 1 deletion tests/unit/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3571,7 +3571,7 @@ def test_lineplot_time_axis(scm_run, time_axis, mod_func):
x="time",
y="value",
estimator=np.median,
ci="sd",
errorbar="sd",
hue="scenario",
other_kwarg="value",
data=mock_return,
Expand Down

0 comments on commit 7798045

Please sign in to comment.