From 3c1a2930fc7440c45978c77c547666b5267dbd30 Mon Sep 17 00:00:00 2001 From: Lukasz Mentel Date: Fri, 3 Jan 2025 22:26:02 +0100 Subject: [PATCH] add tests --- tests/test_element.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/test_element.py b/tests/test_element.py index da081e5..2106d93 100644 --- a/tests/test_element.py +++ b/tests/test_element.py @@ -101,14 +101,14 @@ def test__ne__(): assert e1 != e2 -@pytest.mark.parametrize("e", ELEMENTS) -def test_melting_points_float_or_none(e): - assert isinstance(e.melting_point, (float, type(None))) +@pytest.mark.parametrize("element_obj", ELEMENTS) +def test_melting_points_float_or_none(element_obj): + assert isinstance(element_obj.melting_point, (float, type(None))) -@pytest.mark.parametrize("e", ELEMENTS) -def test_boiling_points_float_or_none(e): - assert isinstance(e.boiling_point, (float, type(None))) +@pytest.mark.parametrize("element_obj", ELEMENTS) +def test_boiling_points_float_or_none(element_obj): + assert isinstance(element_obj.boiling_point, (float, type(None))) @pytest.mark.parametrize("element_obj", ELEMENTS) @@ -130,3 +130,8 @@ def test_protons(element_obj): @pytest.mark.parametrize("element_obj", ELEMENTS) def test_electrons(element_obj): assert element_obj.electrons == element_obj.atomic_number + + +@pytest.mark.parametrize("element_obj", ELEMENTS) +def test_price_per_kg_float_or_none(element_obj): + assert isinstance(element_obj.price_per_kg, (float, type(None)))