Skip to content

Commit c2e52c4

Browse files
committed
rename unit test functions
1 parent 3c6c33c commit c2e52c4

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/test_diagnostics/test_diagnostics_metrics.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def test_compute_hypothesis_test_from_summaries_different_distributions():
135135
assert mmd_observed >= np.quantile(mmd_null, 0.68)
136136

137137

138-
def test_mismatched_last_dimension():
139-
"""Test that a ValueError is raised for mismatched last dimensions."""
138+
def test_compute_hypothesis_test_from_summaries_mismatched_shapes():
139+
"""Test that compute_hypothesis_test_from_summaries raises ValueError for mismatched shapes."""
140140
observed_summaries = np.random.rand(10, 5)
141141
reference_summaries = np.random.rand(20, 4)
142142
num_null_samples = 10
@@ -147,8 +147,10 @@ def test_mismatched_last_dimension():
147147
)
148148

149149

150-
def test_num_null_samples_exceeds_reference_samples():
151-
"""Test that a ValueError is raised when num_null_samples exceeds the number of reference samples."""
150+
def test_compute_hypothesis_test_from_summaries_num_null_samples_exceeds_reference_samples():
151+
"""Test that compute_hypothesis_test_from_summaries raises ValueError when num_null_samples exceeds the number of
152+
reference samples.
153+
"""
152154
observed_summaries = np.random.rand(10, 5)
153155
reference_summaries = np.random.rand(5, 5)
154156
num_null_samples = 10
@@ -250,8 +252,8 @@ def test_compute_hypothesis_test_different_distributions(summary_network, monkey
250252

251253

252254
@pytest.mark.parametrize("summary_network", [lambda data: np.random.rand(data.shape[0], 5)])
253-
def test_compute_hypothesis_test_mismatched_last_dimension(summary_network, monkeypatch):
254-
"""Test that a ValueError is raised for mismatched last dimensions."""
255+
def test_compute_hypothesis_test_mismatched_shapes(summary_network, monkeypatch):
256+
"""Test that compute_hypothesis_test raises ValueError for mismatched shapes."""
255257
observed_data = np.random.rand(10, 5)
256258
reference_data = np.random.rand(20, 4)
257259
num_null_samples = 10
@@ -272,7 +274,8 @@ def test_compute_hypothesis_test_mismatched_last_dimension(summary_network, monk
272274

273275
@pytest.mark.parametrize("summary_network", [lambda data: np.random.rand(data.shape[0], 5), None])
274276
def test_compute_hypothesis_test_num_null_samples_exceeds_reference_samples(summary_network, monkeypatch):
275-
"""Test that a ValueError is raised when num_null_samples exceeds the number of reference samples."""
277+
"""Test that compute_hypothesis_test raises ValueError when num_null_samples exceeds the number of reference
278+
samples."""
276279
observed_data = np.random.rand(10, 5)
277280
reference_data = np.random.rand(5, 5)
278281
num_null_samples = 10

0 commit comments

Comments
 (0)