Skip to content

Commit

Permalink
Clean method lists (#92)
Browse files Browse the repository at this point in the history
* Remove redundant assert in length tests.

* Remove method lists from target and round tests.

* Remove methods lists and commented code in handicap tests.

* Remove methods lists in classification tests.
  • Loading branch information
jatkinson1000 authored Jun 8, 2024
1 parent 2fcff1a commit 0698980
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 277 deletions.
26 changes: 2 additions & 24 deletions archeryutils/classifications/tests/test_agb_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,7 @@


class TestAgbFieldClassificationScores:
"""
Class to test the field classification scores function.
Methods
-------
test_agb_field_classification_scores_ages()
test if expected scores returned for different ages
test_agb_field_classification_scores_genders()
test if expected scores returned for different genders
test_agb_field_classification_scores_bowstyles()
test if expected scores returned for different bowstyles
test_agb_field_classification_scores_invalid()
test invalid inputs
"""
"""Tests for the field classification scores function."""

@pytest.mark.parametrize(
"roundname,age_group,scores_expected",
Expand Down Expand Up @@ -220,16 +207,7 @@ def test_agb_field_classification_scores_invalid(


class TestCalculateAgbFieldClassification:
"""
Class to test the field classification function.
Methods
-------
test_calculate_agb_field_classification_scores()
test if expected sanitised groupname returned
test_calculate_agb_field_classification()
test if expected full-face roundname returned
"""
"""Tests for the field classification function."""

@pytest.mark.parametrize(
"roundname,score,age_group,bowstyle,class_expected",
Expand Down
32 changes: 2 additions & 30 deletions archeryutils/classifications/tests/test_agb_indoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,10 @@

class TestAgbIndoorClassificationScores:
"""
Class to test the agb indoor classification scores function.
Tests for the agb indoor classification scores function.
This will implicitly check the dictionary creation.
Provided sufficient options are covered across bowstyles, genders, and ages.
Methods
-------
test_agb_indoor_classification_scores_ages()
test if expected scores returned for different ages
test_agb_indoor_classification_scores_genders()
test if expected scores returned for different genders
test_agb_indoor_classification_scores_bowstyles()
test if expected scores returned for different bowstyles
test_agb_indoor_classification_scores_triple_faces()
test if triple faces return full face scores
test_agb_indoor_classification_scores_invalid()
test invalid inputs
test_agb_indoor_classification_scores_invalid_round
test invalid roundname
"""

@pytest.mark.parametrize(
Expand Down Expand Up @@ -292,20 +277,7 @@ def test_agb_indoor_classification_scores_invalid_round(


class TestCalculateAgbIndoorClassification:
"""
Class to test the indoor classification function.
Methods
-------
test_calculate_agb_indoor_classification_scores()
test if expected sanitised groupname returned
test_calculate_agb_indoor_classification()
test if expected full-face roundname returned
test_calculate_agb_indoor_classification_invalid_round()
check corrrect error raised for invalid rounds
test_calculate_agb_indoor_classification_invalid_scores()
check corrrect error raised for invalid scores
"""
"""Tests for the indoor classification function."""

@pytest.mark.parametrize(
"score,age_group,bowstyle,class_expected",
Expand Down
26 changes: 2 additions & 24 deletions archeryutils/classifications/tests/test_agb_old_indoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,7 @@


class TestAgbOldIndoorClassificationScores:
"""
Class to test the old_indoor classification scores function.
Methods
-------
test_agb_old_indoor_classification_scores_ages()
test if expected scores returned for different ages
test_agb_old_indoor_classification_scores_genders()
test if expected scores returned for different genders
test_agb_old_indoor_classification_scores_bowstyles()
test if expected scores returned for different bowstyles
test_agb_old_indoor_classification_scores_gent_compound_worcester
test supposed loophole in worcester for gent compound
test_agb_old_indoor_classification_scores_invalid()
test invalid inputs
"""
"""Tests for the old_indoor classification scores function."""

@pytest.mark.parametrize(
"age_group,scores_expected",
Expand Down Expand Up @@ -172,14 +157,7 @@ def test_agb_old_indoor_classification_scores_invalid(


class TestCalculateAgbOldIndoorClassification:
"""
Class to test the old_indoor classification function.
Methods
-------
test_calculate_agb_old_indoor_classification()
test_calculate_agb_old_indoor_classification_invalid_scores()
"""
"""Tests for the old_indoor classification function."""

@pytest.mark.parametrize(
"score,gender,class_expected",
Expand Down
34 changes: 3 additions & 31 deletions archeryutils/classifications/tests/test_agb_outdoor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tests for agb indoor classification functions."""
"""Tests for agb outdoor classification functions."""

import pytest

Expand All @@ -16,25 +16,10 @@

class TestAgbOutdoorClassificationScores:
"""
Class to test the agb outdoor classification scores function.
Tests for the agb outdoor classification scores function.
This will implicitly check the dictionary creation.
Provided sufficient options are covered across bowstyles, genders, and ages.
Methods
-------
test_agb_outdoor_classification_scores_ages()
test if expected scores returned for different ages
test_agb_outdoor_classification_scores_genders()
test if expected scores returned for different genders
test_agb_outdoor_classification_scores_bowstyles()
test if expected scores returned for different bowstyles
test_agb_outdoor_classification_scores_triple_faces()
test if triple faces return full face scores
test_agb_outdoor_classification_scores_invalid()
test invalid inputs
test_agb_outdoor_classification_scores_invalid_round
test invalid roundname
"""

@pytest.mark.parametrize(
Expand Down Expand Up @@ -333,20 +318,7 @@ def test_agb_outdoor_classification_scores_invalid_round(


class TestCalculateAgbOutdoorClassification:
"""
Class to test the outdoor classification function.
Methods
-------
test_calculate_agb_outdoor_classification()
test if expected full-face roundname returned
test_calculate_agb_outdoor_classification_prestige()
check prestige round are working
test_calculate_agb_outdoor_classification_invalid_round()
check corrrect error raised for invalid rounds
test_calculate_agb_outdoor_classification_invalid_scores()
check corrrect error raised for invalid scores
"""
"""Tests for the outdoor classification function."""

@pytest.mark.parametrize(
"roundname,score,age_group,bowstyle,class_expected",
Expand Down
11 changes: 1 addition & 10 deletions archeryutils/classifications/tests/test_classification_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@


class TestStringUtils:
"""
Class to test the get_groupname() function of handicap_equations.
Methods
-------
test_get_groupname()
test if expected sanitised groupname returned
test_strip_spots()
test if expected full-face roundname returned
"""
"""Tests for the string formatting utils of classifications code."""

@pytest.mark.parametrize(
"bowstyle,age_group,gender,groupname_expected",
Expand Down
64 changes: 1 addition & 63 deletions archeryutils/handicaps/tests/test_handicap_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,7 @@


class TestHandicapTable:
"""Class to test the handicap table functionalities of handicap_functions.
Methods
-------
test_format_row
test_table_as_str
test_print_agb
test_print_aa
test_check_print_table_inputs_invalid_rounds
test_check_print_table_inputs_invalid_handicaps
"""
"""Tests for the handicap table functionalities of the HandicapTable class."""

def test_repr(self) -> None:
"""Check HandicapTable representation."""
Expand Down Expand Up @@ -222,54 +211,3 @@ def test_check_print_table_inputs_invalid_handicaps(
match=("Expected float or ndarray for hcs."),
):
hc.HandicapTable("AGB", "a", [york, hereford]) # type: ignore


# @pytest.mark.parametrize(
# "input_table,int_prec,sys,expected",
# [
# (
# np.array([[0, 11, 12, 13], [1, 10, 12, 12]]),
# True,
# "AGB",
# np.array([[0, 11, -9999, 13], [1, 10, 12, 12]]),
# ),
# (
# np.array([[0, 13], [5, 12], [10, 12], [15, 11]]),
# True,
# "AGB",
# np.array([[0, 13], [5, -9999], [10, 12], [15, 11]]),
# ),
# (
# np.array([[4, 13], [3, 12], [2, 12], [1, 11]]),
# True,
# "AA",
# np.array([[4, 13], [3, 12], [2, -9999], [1, 11]]),
# ),
# (
# np.array([[0.0, 11.0, 12.0, 13.0], [1.0, 10.0, 12.0, 12.0]]),
# False,
# "AGB",
# np.array([[0.0, 11.0, np.nan, 13.0], [1.0, 10.0, 12.0, 12.0]]),
# ),
# (
# np.array([[0.0, 11.5, 12.5, 13.5], [1.0, 11.5, 12.0, 13.5]]),
# False,
# "AGB",
# np.array([[0.0, np.nan, 12.5, np.nan], [1.0, 11.5, 12.0, 13.5]]),
# ),
# ],
# )
# def test_clean_repeated(
# self,
# input_table: NDArray[Union[np.int_, np.float_]],
# int_prec: bool,
# sys: str,
# expected: NDArray[Union[np.int_, np.float_]],
# ) -> None:
# """
# Check that abbreviate returns expected results.
# """
# print(hc_func.clean_repeated(input_table, int_prec, sys))
# np.testing.assert_allclose(
# hc_func.clean_repeated(input_table, int_prec, sys), expected
# )
Loading

0 comments on commit 0698980

Please sign in to comment.