test(pyargus): better test for expr_gen

This commit is contained in:
Anand Balakrishnan 2023-10-13 11:08:40 -07:00
parent c68620dfdd
commit f8e570756c
No known key found for this signature in database
3 changed files with 11 additions and 11 deletions

View file

@ -1,14 +1,16 @@
import logging
import hypothesis.strategies as st
from hypothesis import HealthCheck, given, settings
import argus
from argus.test_utils.expr_gen import argus_expr
@given(spec=argus_expr())
@given(data=st.data())
@settings(suppress_health_check=[HealthCheck.too_slow])
def test_correct_expr(spec: str) -> None:
def test_correct_expr(data: st.DataObject) -> None:
spec = data.draw(argus_expr())
try:
_ = argus.parse_expr(spec)
except ValueError as e: