def test_succeeding(series_values, allowed): """Run checks which should succeed""" check_values(series_values, Check.isin(allowed), {})
def test_failing(values, allowed, failure_cases): """Run checks which should fail""" check_values(values, Check.isin(allowed), failure_cases) check_raise_error_or_warning(values, Check.isin(allowed))
def test_failing(values, min_val, failure_cases): """Run checks which should fail""" check_values(values, Check.greater_than_or_equal_to(min_val), failure_cases) check_raise_error_or_warning(values, Check.greater_than_or_equal_to(min_val))
def test_failing(values, value, failure_cases): """Run checks which should fail""" check_values(values, Check.not_equal_to(value), failure_cases) check_raise_error_or_warning(values, Check.not_equal_to(value))
def test_failing(series_values, pattern, failure_cases): """Run checks which should fail""" check_values(series_values, Check.str_matches(pattern), failure_cases) check_raise_error_or_warning(series_values, Check.str_matches(pattern))
def test_argument_check(pattern): """Test invalid arguments""" with pytest.raises(ValueError): Check.str_contains(pattern)
def test_succeeding(values, check_args): """Run checks which should succeed""" check_values(values, Check.in_range(*check_args), {})
def test_succeeding(series_values, forbidden): """Run checks which should succeed""" check_values(series_values, Check.notin(forbidden), {})
def test_failing(values, max_value, failure_cases): """Run checks which should fail""" check_values(values, Check.less_than_or_equal_to(max_value), failure_cases) check_raise_error_or_warning(values, Check.less_than_or_equal_to(max_value))
def test_failing_with_none(values, max_value): """Validate the check works also on dataframes with None values""" check_none_failures(values, Check.less_than_or_equal_to(max_value))
def test_succeeding(values, max_value): """Run checks which should succeed""" check_values(values, Check.less_than_or_equal_to(max_value), {})
def test_argument_check(): """Test if None is accepted as boundary""" with pytest.raises(ValueError): Check.less_than_or_equal_to(max_value=None)
def test_failing_with_none(values, min_val): """Validate the check works also on dataframes with None values""" check_none_failures(values, Check.greater_than_or_equal_to(min_val))
def test_failing_with_none(values, allowed): """Validate the check works also on dataframes with None values""" check_none_failures(values, Check.isin(allowed))
def test_failing(values, check_args, failure_cases): """Run checks which should fail""" check_values(values, Check.in_range(*check_args), failure_cases) check_raise_error_or_warning(values, Check.in_range(*check_args))
def test_argument_check(args): """Test invalid arguments""" with pytest.raises(ValueError): Check.notin(*args)
def test_failing_with_none(values, check_args): """Validate the check works also on dataframes with None values""" check_none_failures(values, Check.in_range(*check_args))
def test_failing(series_values, forbidden, failure_cases): """Run checks which should fail""" check_values(series_values, Check.notin(forbidden), failure_cases) check_raise_error_or_warning(series_values, Check.notin(forbidden))
def test_failing_with_none(series_values, value): """Validate the check works also on dataframes with None values""" check_none_failures(series_values, Check.equal_to(value))
def test_failing_with_none(series_values, pattern): """Validate the check works also on dataframes with None values""" check_none_failures(series_values, Check.str_matches(pattern))
def test_succeeding(series_values, value): """Run checks which should succeed""" check_values(series_values, Check.not_equal_to(value), {})
def test_succeeding(series_values, pattern): """Run checks which should succeed""" check_values(series_values, Check.str_contains(pattern), {})
def test_succeeding(values, min_val): """Run checks which should succeed""" check_values(values, Check.greater_than_or_equal_to(min_val), {})