Skip to content

Commit 3a8cec5

Browse files
committed
feat(tests): Add another test to fix codecov failures
1 parent 8d723b2 commit 3a8cec5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

causalpy/tests/test_synthetic_data.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,22 @@ def test_generate_regression_discontinuity_data():
6060
N=50, true_causal_impact=1.0, true_treatment_threshold=0.5
6161
)
6262
assert len(df_custom) == 50
63+
64+
65+
def test_generate_synthetic_control_data():
66+
"""
67+
Test the generate_synthetic_control_data function.
68+
"""
69+
from causalpy.data.simulate_data import generate_synthetic_control_data
70+
71+
# Test with default parameters (lowess_kwargs=None)
72+
df, weightings = generate_synthetic_control_data()
73+
assert isinstance(df, pd.DataFrame)
74+
assert isinstance(weightings, np.ndarray)
75+
assert len(df) == 100 # default N value
76+
77+
# Test with explicit lowess_kwargs
78+
df_custom, weightings_custom = generate_synthetic_control_data(
79+
N=50, lowess_kwargs={"frac": 0.3, "it": 5}
80+
)
81+
assert len(df_custom) == 50

0 commit comments

Comments
 (0)