diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cfeacfc..489ac47 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-asyncio openai python-dotenv Pillow matplotlib pandas aiohttp scikit-learn + pip install pytest pytest-asyncio openai python-dotenv Pillow matplotlib pandas aiohttp scikit-learn pytest-mpl pip install -e . - name: Run tests diff --git a/tests/baseline/test_plotting.png b/tests/baseline/test_plotting.png new file mode 100644 index 0000000..c20f410 Binary files /dev/null and b/tests/baseline/test_plotting.png differ diff --git a/tests/test_confusion_matrix.py b/tests/test_confusion_matrix.py index 7e1a9e8..366123d 100644 --- a/tests/test_confusion_matrix.py +++ b/tests/test_confusion_matrix.py @@ -26,6 +26,14 @@ def close_figures(): plt.close("all") +@pytest.mark.mpl_image_compare(tolerance=60) +def test_plotting(sample_df): + from lars.util.confusion_matrix import plot_confusion_matrix + + fig, ax = plt.subplots() + plot_confusion_matrix(sample_df, ax=ax) + return fig + def test_title_is_set(sample_df): from lars.util.confusion_matrix import plot_confusion_matrix