Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Mar 15, 2024
1 parent afbea38 commit 0ea7c74
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion py-polars/tests/unit/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@

import pytest

from polars.plugins import _is_dynamic_lib, _resolve_plugin_path, _serialize_kwargs
import polars as pl
from polars.plugins import (
_is_dynamic_lib,
_resolve_plugin_path,
_serialize_kwargs,
register_plugin_function,
)


@pytest.mark.write_disk()
def test_register_plugin_function_invalid_plugin_path(tmp_path: Path) -> None:
tmp_path.mkdir(exist_ok=True)
plugin_path = tmp_path / "lib.so"
plugin_path.touch()

expr = register_plugin_function(
plugin_path=plugin_path, function_name="hello", args=5
)

with pytest.raises(pl.ComputeError, match="error loading dynamic library"):
pl.select(expr)


@pytest.mark.parametrize(
Expand Down

0 comments on commit 0ea7c74

Please sign in to comment.