MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_normalize_weights

Function test_normalize_weights

lib/matplotlib/tests/test_font_manager.py:597–614  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

595
596
597def test_normalize_weights():
598 assert _normalize_weight(300) == 300 # passthrough
599 assert _normalize_weight('ultralight') == 100
600 assert _normalize_weight('light') == 200
601 assert _normalize_weight('normal') == 400
602 assert _normalize_weight('regular') == 400
603 assert _normalize_weight('book') == 400
604 assert _normalize_weight('medium') == 500
605 assert _normalize_weight('roman') == 500
606 assert _normalize_weight('semibold') == 600
607 assert _normalize_weight('demibold') == 600
608 assert _normalize_weight('demi') == 600
609 assert _normalize_weight('bold') == 700
610 assert _normalize_weight('heavy') == 800
611 assert _normalize_weight('extra bold') == 800
612 assert _normalize_weight('black') == 900
613 with pytest.raises(KeyError):
614 _normalize_weight('invalid')
615
616
617def test_font_match_warning(caplog):

Callers

nothing calls this directly

Calls 1

_normalize_weightFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…