(mixed_grouping_size)
| 285 | |
| 286 | |
| 287 | def test_validate_schema_mixed(mixed_grouping_size): |
| 288 | grouping, size = mixed_grouping_size |
| 289 | schema = make_schema_with_nones(grouping) |
| 290 | validate_grouping(grouping, schema) |
| 291 | |
| 292 | # check validation failures |
| 293 | with pytest.raises(SchemaTypeValidationError): |
| 294 | validate_grouping(None, schema) |
| 295 | |
| 296 | # Check invalid list/tuple value |
| 297 | if isinstance(schema, (list, tuple)): |
| 298 | err = SchemaLengthValidationError |
| 299 | else: |
| 300 | err = SchemaTypeValidationError |
| 301 | with pytest.raises(err): |
| 302 | validate_grouping((None,), schema) |
| 303 | |
| 304 | # Check invalid dict value |
| 305 | if isinstance(schema, dict): |
| 306 | err = SchemaKeysValidationError |
| 307 | else: |
| 308 | err = SchemaTypeValidationError |
| 309 | |
| 310 | with pytest.raises(err): |
| 311 | validate_grouping({"A": 0, "bogus": 2}, schema) |
nothing calls this directly
no test coverage detected
searching dependent graphs…