Skip to content

Commit

Permalink
fixed test strategy for year formats.
Browse files Browse the repository at this point in the history
Signed-off-by: DanielAvdar <[email protected]>
  • Loading branch information
DanielAvdar committed Feb 25, 2024
1 parent e7f6927 commit 1edd48f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/unit/test_property_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def shmessy_bool_st(draw) -> pd.Series:
@st.composite
def dt_st(draw, patterns) -> pd.Series:
pattern = draw(st.sampled_from(patterns))
hp.assume('Y' in pattern) # format y instead of Y probably have pandas bug with .dt.strftime(pattern)
pd_series = draw(
series(
dtype="datetime64[ns]",
Expand All @@ -66,6 +65,7 @@ def dt_st(draw, patterns) -> pd.Series:
)
)
hp.assume(pd_series.notna().all())
hp.assume('Y' in pattern or (pd_series.dt.year > 1900).all())
return pd_series.dt.strftime(pattern)


Expand Down

0 comments on commit 1edd48f

Please sign in to comment.