From 5492ad8718b46854c8fc0530e9f1d28be4dba89e Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Sun, 29 Dec 2024 21:08:09 -0500 Subject: [PATCH] test: remove test for the correct mu, improve test comment for invalid inputs --- tests/test_tools.py | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/tests/test_tools.py b/tests/test_tools.py index d02996ca..d3f7cf16 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -167,35 +167,11 @@ def test_get_package_info(monkeypatch, inputs, expected): assert actual_metadata == expected -@pytest.mark.parametrize( - "inputs, expected_mu", - [ - # Test whether the function returns the correct mu - ( # C1: Composition, energy, and mass density provided, expect to get mu based on mass density - # 1. Fully dense mass density - {"sample_composition": "quartz", "energy": 10, "sample_mass_density": 2.65}, - 5.0368, - ), - ( # 2. Measured mass density - { - "sample_composition": "ZrO2", - "energy": 17.445, - "sample_mass_density": 1.009, - }, - 1.2522, - ), - ], -) -def test_compute_mu_using_xraydb(inputs, expected_mu): - actual_mu = compute_mu_using_xraydb(**inputs) - assert actual_mu == pytest.approx(expected_mu, rel=1e-6, abs=1e-4) - - @pytest.mark.parametrize( "inputs", [ - # Test when the function raises ValueError - # C1: Both mass density and packing fraction are provided + # Test when the function has invalid inputs + # C1: Both mass density and packing fraction are provided, expect ValueError exception ( { "sample_composition": "quartz", @@ -204,7 +180,7 @@ def test_compute_mu_using_xraydb(inputs, expected_mu): "packing_fraction": 1, } ), - # C2: None of mass density or packing fraction are provided + # C2: None of mass density or packing fraction are provided, expect ValueError exception ( { "sample_composition": "quartz",