(dali_tbs, python_tbs, end_glob=origin_trace_glob)
| 100 | |
| 101 | |
| 102 | def compare_traces(dali_tbs, python_tbs, end_glob=origin_trace_glob): |
| 103 | assert len(dali_tbs) == len(python_tbs) |
| 104 | regex = fnmatch.translate(end_glob(op_mode)) |
| 105 | for dali_tb, python_tb in zip(dali_tbs, python_tbs): |
| 106 | err = f"Comparing dali_tb:\n{dali_tb}\nvs python_tb:\n{python_tb}" |
| 107 | # Check if we skipped just one frame in python_tb (2 lines) |
| 108 | assert dali_tb.count("\n") == python_tb.count("\n") + 2, err |
| 109 | assert dali_tb.startswith(python_tb), err |
| 110 | assert re.match(regex, dali_tb), f"{dali_tb} didn't match the expected end traceback" |
| 111 | |
| 112 | |
| 113 | test_modes = ["dali.fn", "dali.ops"] |
no test coverage detected