-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relocate hypothesis unit tests to parallel
tests_parametric
dir (#3899
- Loading branch information
1 parent
84c5170
commit 6adbff3
Showing
11 changed files
with
210 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# ------------------------------------------------- | ||
# Validate Series behaviour with parameteric tests | ||
# ------------------------------------------------- | ||
from hypothesis import given | ||
|
||
import polars as pl | ||
from polars.testing import dataframes | ||
|
||
|
||
@given(df=dataframes()) | ||
def test_repr(df: pl.DataFrame) -> None: | ||
assert isinstance(repr(df), str) | ||
# print(df) | ||
|
||
|
||
@given(df=dataframes(allowed_dtypes=[pl.Boolean, pl.UInt64, pl.Utf8, pl.Time])) | ||
def test_null_count(df: pl.DataFrame) -> None: | ||
null_count, ncols = df.null_count(), len(df.columns) | ||
if ncols == 0: | ||
assert null_count.shape == (0, 0) | ||
else: | ||
assert null_count.shape == (1, ncols) | ||
for idx, count in enumerate(null_count.rows()[0]): | ||
assert count == sum(v is None for v in df.select_at_idx(idx).to_list()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# TODO: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# ------------------------------------------------- | ||
# Validate Series behaviour with parameteric tests | ||
# ------------------------------------------------- | ||
|
||
# from hypothesis import given | ||
# | ||
# import polars as pl | ||
# from polars.testing import ( | ||
# series, | ||
# verify_series_and_expr_api, | ||
# ) | ||
# | ||
# | ||
# # TODO: exclude obvious/known overflow inside the strategy before commenting back in | ||
# @given(s=series(allowed_dtypes=_NUMERIC_COL_TYPES, name="a")) | ||
# def test_cum_agg_extra(s: pl.Series) -> None: | ||
# # confirm that ops on generated Series match equivalent Expr call | ||
# # note: testing codepath-equivalence, not correctness. | ||
# for op in ("cumsum", "cummin", "cummax", "cumprod"): | ||
# verify_series_and_expr_api(s, None, op) |
Oops, something went wrong.