diff --git a/archeryutils/classifications/agb_outdoor_classifications.py b/archeryutils/classifications/agb_outdoor_classifications.py index 8c79069..e288e9b 100644 --- a/archeryutils/classifications/agb_outdoor_classifications.py +++ b/archeryutils/classifications/agb_outdoor_classifications.py @@ -7,7 +7,7 @@ agb_outdoor_classification_scores """ -from typing import Any, Literal, Optional, TypedDict, cast +from typing import Any, Literal, TypedDict, cast import numpy as np import numpy.typing as npt @@ -575,7 +575,7 @@ def agb_outdoor_classification_fraction( # noqa: PLR0913 Too many arguments bowstyle: str, gender: str, age_group: str, - restrict: Optional[bool] = True, + restrict: bool | None = True, ) -> float: """ Calculate the fraction towards the next classification an archer is. diff --git a/archeryutils/classifications/tests/test_agb_indoor.py b/archeryutils/classifications/tests/test_agb_indoor.py index 199be9a..e2eb924 100644 --- a/archeryutils/classifications/tests/test_agb_indoor.py +++ b/archeryutils/classifications/tests/test_agb_indoor.py @@ -87,7 +87,7 @@ def test_agb_indoor_classification_scores_ages( age_group=age_group, ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "age_group,scores_expected", @@ -128,7 +128,7 @@ def test_agb_indoor_classification_scores_genders( age_group=age_group, ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "bowstyle,scores_expected", @@ -160,7 +160,7 @@ def test_agb_indoor_classification_scores_bowstyles( age_group="adult", ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "bowstyle,scores_expected", @@ -192,7 +192,7 @@ def test_agb_indoor_classification_scores_nonbowstyles( age_group="adult", ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "roundname,scores_expected", @@ -228,7 +228,7 @@ def test_agb_indoor_classification_scores_triple_faces( age_group="adult", ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "roundname,bowstyle,gender,age_group", @@ -469,7 +469,7 @@ def test_agb_indoor_classification_fraction( # noqa: PLR0913 Too many arguments age_group=age_group, ) - assert frac_returned == frac_expected + assert frac_returned == pytest.approx(frac_expected) @pytest.mark.parametrize( "roundname,score,age_group,bowstyle,frac_expected", @@ -521,7 +521,7 @@ def test_agb_indoor_classification_fraction_low( # noqa: PLR0913 many args age_group=age_group, ) - assert frac_returned == frac_expected + assert frac_returned == pytest.approx(frac_expected) @pytest.mark.parametrize( "roundname,score,age_group,bowstyle,frac_expected", @@ -573,4 +573,4 @@ def test_agb_indoor_classification_fraction_high( # noqa: PLR0913 Too many args age_group=age_group, ) - assert frac_returned == frac_expected + assert frac_returned == pytest.approx(frac_expected) diff --git a/archeryutils/classifications/tests/test_agb_outdoor.py b/archeryutils/classifications/tests/test_agb_outdoor.py index a99f689..9ec628f 100644 --- a/archeryutils/classifications/tests/test_agb_outdoor.py +++ b/archeryutils/classifications/tests/test_agb_outdoor.py @@ -97,7 +97,7 @@ def test_agb_outdoor_classification_scores_ages( age_group=age_group, ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "roundname,age_group,scores_expected", @@ -143,7 +143,7 @@ def test_agb_outdoor_classification_scores_genders( age_group=age_group, ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "roundname,bowstyle,gender,scores_expected", @@ -201,7 +201,7 @@ def test_agb_outdoor_classification_scores_bowstyles( age_group="adult", ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "roundname,bowstyle,gender,scores_expected", @@ -241,7 +241,7 @@ def test_agb_outdoor_classification_scores_nonbowstyles( age_group="adult", ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "roundname,scores_expected", @@ -269,7 +269,7 @@ def test_agb_outdoor_classification_scores_triple_faces( age_group="adult", ) - assert scores == scores_expected[::-1] + assert scores == pytest.approx(scores_expected[::-1]) @pytest.mark.parametrize( "roundname,bowstyle,gender,age_group", @@ -621,7 +621,7 @@ def test_agb_outdoor_classification_fraction( # noqa: PLR0913 many args age_group=age_group, ) - assert frac_returned == frac_expected + assert frac_returned == pytest.approx(frac_expected) @pytest.mark.parametrize( "roundname,score,age_group,bowstyle,frac_expected", @@ -673,7 +673,7 @@ def test_agb_outdoor_classification_fraction_low( # noqa: PLR0913 many args age_group=age_group, ) - assert frac_returned == frac_expected + assert frac_returned == pytest.approx(frac_expected) @pytest.mark.parametrize( "roundname,score,age_group,bowstyle,frac_expected", @@ -725,7 +725,7 @@ def test_agb_outdoor_classification_fraction_high( # noqa: PLR0913 many args age_group=age_group, ) - assert frac_returned == frac_expected + assert frac_returned == pytest.approx(frac_expected) def test_agb_outdoor_classification_fraction_restrict( self, @@ -749,4 +749,4 @@ def test_agb_outdoor_classification_fraction_restrict( restrict=False, ) - assert frac_unrestricted == 0.4541258975704667 + assert frac_unrestricted == pytest.approx(0.4541258975704667)