Skip to content

Commit da6c91d

Browse files
committed
add tests to detect NotImplementedError exception
1 parent 3fd642e commit da6c91d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

causalpy/tests/test_integration_pymc_examples.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def test_did():
4949
fig, ax = result.plot()
5050
assert isinstance(fig, plt.Figure)
5151
assert isinstance(ax, plt.Axes)
52+
with pytest.raises(NotImplementedError):
53+
result.get_plot_data()
5254

5355

5456
# TODO: set up fixture for the banks dataset
@@ -192,6 +194,8 @@ def test_rd():
192194
fig, ax = result.plot()
193195
assert isinstance(fig, plt.Figure)
194196
assert isinstance(ax, plt.Axes)
197+
with pytest.raises(NotImplementedError):
198+
result.get_plot_data()
195199

196200

197201
@pytest.mark.integration
@@ -311,6 +315,8 @@ def test_rkink():
311315
fig, ax = result.plot()
312316
assert isinstance(fig, plt.Figure)
313317
assert isinstance(ax, plt.Axes)
318+
with pytest.raises(NotImplementedError):
319+
result.get_plot_data()
314320

315321

316322
@pytest.mark.integration
@@ -664,6 +670,8 @@ def test_iv_reg():
664670
assert isinstance(result, cp.InstrumentalVariable)
665671
assert len(result.idata.posterior.coords["chain"]) == sample_kwargs["chains"]
666672
assert len(result.idata.posterior.coords["draw"]) == sample_kwargs["draws"]
673+
with pytest.raises(NotImplementedError):
674+
result.get_plot_data()
667675

668676

669677
@pytest.mark.integration
@@ -714,6 +722,8 @@ def test_inverse_prop():
714722
assert isinstance(fig, plt.Figure)
715723
assert isinstance(axs, list)
716724
assert all(isinstance(ax, plt.Axes) for ax in axs)
725+
with pytest.raises(NotImplementedError):
726+
result.get_plot_data()
717727

718728

719729
# DEPRECATION WARNING TESTS ============================================================

causalpy/tests/test_integration_skl_examples.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def test_did():
4747
fig, ax = result.plot()
4848
assert isinstance(fig, plt.Figure)
4949
assert isinstance(ax, plt.Axes)
50+
with pytest.raises(NotImplementedError):
51+
result.get_plot_data()
5052

5153

5254
@pytest.mark.integration
@@ -78,6 +80,8 @@ def test_rd_drinking():
7880
fig, ax = result.plot()
7981
assert isinstance(fig, plt.Figure)
8082
assert isinstance(ax, plt.Axes)
83+
with pytest.raises(NotImplementedError):
84+
result.get_plot_data()
8185

8286

8387
@pytest.mark.integration

0 commit comments

Comments
 (0)