MCPcopy Index your code
hub / github.com/pathwaycom/pathway / test_float_div_zero

Function test_float_div_zero

python/pathway/tests/test_operators.py:462–481  ·  view source on GitHub ↗
(op_fun: Any)

Source from the content-addressed store, hash-verified

460 ],
461)
462def test_float_div_zero(op_fun: Any):
463 pairs = np.array(
464 [
465 [1, 0],
466 [10000, 0],
467 [-1, 0],
468 [0, 0],
469 [-9829480, 0],
470 [12.452, 0.0],
471 [0.001, 0.0],
472 ],
473 dtype=np.float64,
474 ).reshape(-1, 2, 1)
475 for pair in pairs:
476 df = pd.DataFrame({"a": pair[0], "b": pair[1]})
477 table = table_from_pandas(df)
478 table.select(c=op_fun(pw.this["a"], pw.this["b"]))
479
480 with pytest.raises(ZeroDivisionError):
481 run_all()
482
483
484@pytest.mark.parametrize("reverse", [True, False])

Callers

nothing calls this directly

Calls 3

table_from_pandasFunction · 0.90
run_allFunction · 0.90
selectMethod · 0.45

Tested by

no test coverage detected