Skip to content

Commit

Permalink
Add missing test_ prefix in test_main
Browse files Browse the repository at this point in the history
  • Loading branch information
leavauchier committed Nov 28, 2023
1 parent 63dc833 commit 3a4704a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,24 @@ def setup_module():
shutil.rmtree(TMP_PATH)


def read_metrics_weights_ok():
weights_file = Path("./test/configs/metrics_weights.yaml")
def test_read_metrics_weights_ok():
weights_file = Path("./test/configs/metrics_weights_test.yaml")
weights = main.read_metrics_weights(weights_file)
assert all([k in main.METRICS.keys() for k in weights.keys()])
for _, val in weights.items():
assert isinstance(val, dict)
assert all([isinstance(cl, str) for cl in val.keys()])


def read_metrics_weights_fail():
def test_read_metrics_weights_fail():
weights_file = Path("./test/configs/metrics_weights_fail.yaml")
with pytest.raises(ValueError):
main.read_metrics_weights(weights_file)


def read_metrics_weights_different_spacing():
weights_file = Path("./test/configs/metrics_weights_fail.yaml")
with pytest.raises(ValueError):
weights = main.read_metrics_weights(weights_file)
def test_read_metrics_weights_different_spacing():
weights_file = Path("./test/configs/metrics_weights_different_spacing.yaml")
weights = main.read_metrics_weights(weights_file)
assert all([k in main.METRICS.keys() for k in weights.keys()])
expected_classes = {"1", "2", "3_4"}
for _, val in weights.items():
Expand Down

0 comments on commit 3a4704a

Please sign in to comment.