mirror of
https://github.com/Doctorado-ML/bayesclass.git
synced 2025-08-15 15:45:54 +00:00
Add some tests and remove .coveragerc
This commit is contained in:
21
.coveragerc
21
.coveragerc
@@ -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
|
BIN
bayesclass/tests/baseline_images/test_AODE/line_dashes_AODE.png
Normal file
BIN
bayesclass/tests/baseline_images/test_AODE/line_dashes_AODE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
@@ -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()
|
||||
|
@@ -1,7 +0,0 @@
|
||||
import doctest
|
||||
import bayesclass
|
||||
|
||||
|
||||
def load_tests(loader, tests, ignore):
|
||||
tests.addTests(doctest.DocTestSuite(bayesclass))
|
||||
return tests
|
@@ -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
|
||||
|
Reference in New Issue
Block a user