diff --git a/tests/io/test_io.py b/tests/io/test_io.py index ed753295d..d82542a01 100644 --- a/tests/io/test_io.py +++ b/tests/io/test_io.py @@ -377,27 +377,6 @@ def test_to_yaml(): assert yaml_str_schema_method.strip() == YAML_SCHEMA.strip() -@pytest.mark.skipif( - SKIP_YAML_TESTS, - reason="pyyaml >= 5.1.0 required", -) -def test_to_yaml_missing_checks(): - """Test that to_yaml warns when using unregistered checks on columns/globally.""" - schema = _create_schema() - unregistered = pa.Check(lambda _: False) - schema.columns["int_column"]._checks.append(unregistered) - - with pytest.warns(UserWarning, match=".*registered checks.*"): - io.to_yaml(schema) - - del schema.columns["int_column"]._checks[-1] - - schema.checks.append(unregistered) - - with pytest.warns(UserWarning, match=".*registered checks.*"): - io.to_yaml(schema) - - @pytest.mark.skipif( SKIP_YAML_TESTS, reason="pyyaml >= 5.1.0 required", @@ -578,7 +557,7 @@ def ncols_gt(pandas_obj: pd.DataFrame, column_count: int) -> bool: def test_to_yaml_custom_dataframe_check(): - """Tests that writing DataFrameSchema with a registered dataframe raises.""" + """Tests that writing DataFrameSchema with an unregistered check raises.""" schema = pa.DataFrameSchema( { @@ -592,6 +571,8 @@ def test_to_yaml_custom_dataframe_check(): with pytest.warns(UserWarning, match=".*registered checks.*"): pa.io.to_yaml(schema) + # the unregistered column check case is tested in `test_to_yaml_lambda_check` + def test_to_yaml_bugfix_419(): """Ensure that GH#419 is fixed"""