MCPcopy
hub / github.com/msgspec/msgspec / test_pyyaml_not_installed_error

Function test_pyyaml_not_installed_error

tests/unit/test_yaml.py:47–54  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

45
46
47def test_pyyaml_not_installed_error(monkeypatch):
48 monkeypatch.setitem(sys.modules, "yaml", None)
49
50 with pytest.raises(ImportError, match="PyYAML"):
51 msgspec.yaml.encode(1)
52
53 with pytest.raises(ImportError, match="PyYAML"):
54 msgspec.yaml.decode("1", type=int)
55
56
57@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…