diff --git a/.vscode/settings.json b/.vscode/settings.json index ad7af29..b061595 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "python.testing.pytestArgs": [ - "tests" + "tests", + "--no-cov" ], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true diff --git a/tests/component/test_source_model.py b/tests/component/test_source_model.py index 1e0507e..16ae1f7 100644 --- a/tests/component/test_source_model.py +++ b/tests/component/test_source_model.py @@ -99,6 +99,14 @@ def test_make_sampler(source_model): assert isinstance(sampler_object[0], NormalNormal) +def test_coverage_function(source_model): + """Test that the coverage function has defaulted correctly.""" + random_vars = np.random.normal(0, 1, size=(10000, 1)) + threshold_value = source_model.threshold_function(random_vars) + assert threshold_value.shape == (1, ) + assert np.allclose(threshold_value, np.quantile(random_vars, 0.95)) + + def test_birth_function(source_model): """Test the birth_function implementation, and some aspects of the reversible jump sampler.