def test_convert_js_arg(arg, expected): if expected is TypeError: with pytest.raises(TypeError): javascript._convert_js_arg(arg) else: assert javascript._convert_js_arg(arg) == expected