pandera/strategies/pandas_strategies.py uses truthiness checks on Hypothesis strategies (if strategy:), which triggers repeated HypothesisWarning messages.
Minimal Reproducible Example (MRE):
pytest -q tests/strategies/test_strategies.py -k "strategy" --maxfail=1
Observed warning snippet:
pandera/strategies/pandas_strategies.py:832: HypothesisWarning: bool(from_dtype(...)) is always True, did you mean to draw a value?
if strategy:
Also appears at another location:
pandera/strategies/pandas_strategies.py:1055: HypothesisWarning: ...
if strategy:
Current Behavior:
The suite emits many HypothesisWarning messages because strategy objects are evaluated in boolean context.
Expected Behavior:
Pandera should use explicit None checks (if strategy is not None: / if strategy is None:) instead of strategy truthiness so Hypothesis warnings are not emitted for this condition.
The MRE run screenshot:

pandera/strategies/pandas_strategies.pyuses truthiness checks on Hypothesis strategies (if strategy:), which triggers repeatedHypothesisWarningmessages.Minimal Reproducible Example (MRE):
pytest -q tests/strategies/test_strategies.py -k "strategy" --maxfail=1Observed warning snippet:
Also appears at another location:
Current Behavior:
The suite emits many
HypothesisWarningmessages because strategy objects are evaluated in boolean context.Expected Behavior:
Pandera should use explicit
Nonechecks (if strategy is not None:/if strategy is None:) instead of strategy truthiness so Hypothesis warnings are not emitted for this condition.The MRE run screenshot: