diff --git a/fastpath/fastpath/core.py b/fastpath/fastpath/core.py index e3849d47..7ce26f5a 100644 --- a/fastpath/fastpath/core.py +++ b/fastpath/fastpath/core.py @@ -1649,8 +1649,12 @@ def process_measurement(msm_tup) -> None: sw_version = measurement.get("software_version", "unknown") test_version = g_or(measurement, "test_version", "") test_runtime = g_or(measurement, "test_runtime", 0.0) - test_helper_address = g(measurement, "test_helpers", "backend", "address", default="") - test_helper_type = g(measurement, "test_helpers", "backend", "type", default="") + try: + test_helper_address = g(measurement, "test_helpers", "backend", "address", default="") + test_helper_type = g(measurement, "test_helpers", "backend", "type", default="") + except AttributeError: + test_helper_address = "" + test_helper_type = "" annot = measurement.get("annotations") if not isinstance(annot, dict): diff --git a/fastpath/fastpath/tests/test_unit.py b/fastpath/fastpath/tests/test_unit.py index 653feee9..b97c7788 100644 --- a/fastpath/fastpath/tests/test_unit.py +++ b/fastpath/fastpath/tests/test_unit.py @@ -55,6 +55,10 @@ def test_extract_input_domain_meek(): def test_g(): g = fp.g assert g({}, "x", default="v") == "v" + assert g(dict(x=dict()), "x", "y", default="v") == "v" + assert g(dict(x=dict(y=None)), "x", "y", default="v") == "v" + assert g(dict(x=dict(y="22")), "x", "y", default="v") == "22" + #assert g(dict(x="str"), "x", "y", default="v") == "v" def test_gn():