diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 8b87660..0000000 --- a/.coveragerc +++ /dev/null @@ -1,21 +0,0 @@ -# Configuration for coverage.py - -[run] -branch = True -source = bayesclass -include = */bayesclass/* -omit = - */setup.py - -[report] -exclude_lines = - pragma: no cover - def __repr__ - if self.debug: - if settings.DEBUG - raise AssertionError - raise NotImplementedError - if 0: - if __name__ == .__main__.: - if self.verbose: -show_missing = True \ No newline at end of file diff --git a/bayesclass/tests/baseline_images/test_AODE/line_dashes_AODE.png b/bayesclass/tests/baseline_images/test_AODE/line_dashes_AODE.png new file mode 100644 index 0000000..f5a0a8c Binary files /dev/null and b/bayesclass/tests/baseline_images/test_AODE/line_dashes_AODE.png differ diff --git a/bayesclass/tests/baseline_images/test_KDB/line_dashes_KDB.png b/bayesclass/tests/baseline_images/test_KDB/line_dashes_KDB.png index 9d9ac71..45f293b 100644 Binary files a/bayesclass/tests/baseline_images/test_KDB/line_dashes_KDB.png and b/bayesclass/tests/baseline_images/test_KDB/line_dashes_KDB.png differ diff --git a/bayesclass/tests/test_AODE.py b/bayesclass/tests/test_AODE.py index fa0606c..16f6c58 100644 --- a/bayesclass/tests/test_AODE.py +++ b/bayesclass/tests/test_AODE.py @@ -2,6 +2,8 @@ import pytest import numpy as np from sklearn.datasets import load_iris from sklearn.preprocessing import KBinsDiscretizer +from matplotlib.testing.decorators import image_comparison +from matplotlib.testing.conftest import mpl_test_settings from bayesclass.bayesclass import AODE @@ -37,6 +39,17 @@ def test_AODE_default_hyperparameters(data, clf): ] +@image_comparison( + baseline_images=["line_dashes_AODE"], remove_text=True, extensions=["png"] +) +def test_AODE_plot(data, clf): + # mpl_test_settings will automatically clean these internal side effects + mpl_test_settings + dataset = load_iris(as_frame=True) + clf.fit(*data, features=dataset["feature_names"]) + clf.plot("AODE Iris") + + def test_AODE_version(clf): """Check AODE version.""" assert __version__ == clf.version() diff --git a/bayesclass/tests/test_doctest.py b/bayesclass/tests/test_doctest.py deleted file mode 100644 index 9eef3a0..0000000 --- a/bayesclass/tests/test_doctest.py +++ /dev/null @@ -1,7 +0,0 @@ -import doctest -import bayesclass - - -def load_tests(loader, tests, ignore): - tests.addTests(doctest.DocTestSuite(bayesclass)) - return tests diff --git a/pyproject.toml b/pyproject.toml index edea8f6..97197ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,8 @@ addopts = "--cov --cov-report html --cov-report term-missing --cov-fail-under 95 [tool.coverage.run] source = ["bayesclass"] +[tool.coverage.report] +show_missing = true [tool.black] line-length = 79