Commit 3b669c89 authored by Jan Kiene's avatar Jan Kiene
Browse files

introduce dummy threshold and use xfail instead of skip

parent e7e90bc6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ INPUT_FILES = [TESTV_DIR / "stv3OA48c.wav"]
CONVENTIONS = [c.value for c in AMBI_CONVENTION]
AMBI_CONVERTER_PATH_FLOAT = HERE.parent / "ambi_converter_flt"
AMBI_CONVERTER_PATH_FIXED = HERE.parent / "ambi_converter_fx"
THRESHOLD_FAIL = 2


@pytest.mark.parametrize("infile", INPUT_FILES)
@@ -63,7 +64,7 @@ def test_ambi_converter(
        convention_out != AMBI_CONVENTION.ACN_SN3D
        and convention_in != AMBI_CONVENTION.ACN_SN3D
    ):
        pytest.skip("One of in and out convention needs to be ACN_SN3D")
        pytest.xfail("One of in and out convention needs to be ACN_SN3D")

    with TemporaryDirectory() as tmp_dir:
        outfile_base = Path(tmp_dir) / (
@@ -93,7 +94,7 @@ def test_ambi_converter(
        s_fx, _ = audiofile.readfile(outfile_fx)

        cmp_result = audioarray.compare(s_flt, s_fx, fs=48000, per_frame=False)
        if not cmp_result["bitexact"]:
        if abs(cmp_result["max_abs_diff"]) > THRESHOLD_FAIL:
            pytest.fail(
                f"Difference between float and fixed ambi_converter output found! Max abs diff: {cmp_result['max_abs_diff']}"
            )