Skip to content

Commit 87117bf

Browse files
committed
tests
1 parent 175e614 commit 87117bf

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

tests/test_constructors.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,21 @@ def test_constructors(
8585
else:
8686
raise TypeError(f"Unexpected type {type(expected_value[0])}!")
8787
check_test_result(dtype, test_method, result, expected_value)
88+
89+
90+
@pytest.mark.parametrize(
91+
"test_method, args, kwargs",
92+
[
93+
(ul.random, (), {"size": 3, "dtype": "float32"},),
94+
],
95+
)
96+
def test_rand(
97+
test_method: Callable,
98+
args: tuple,
99+
kwargs: dict,
100+
) -> None:
101+
arr1 = test_method(*args, **kwargs)
102+
arr2 = test_method(*args, **kwargs)
103+
assert arr1.not_equal(arr2).all()
104+
assert len(arr1) == len(arr2)
105+
assert len(arr1) == kwargs["size"]

ulist/python/ulist/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .constructor import arange, cycle, from_seq, repeat # noqa:F401
1+
from .constructor import arange, cycle, from_seq, random, repeat # noqa:F401
22
from .control_flow import select # noqa:F401
33
from .core import UltraFastList # noqa:F401
44
from .io import read_csv # noqa:F401

0 commit comments

Comments
 (0)