def test_make_xref(param_type, expected_result): assert make_xref(param_type, xref_aliases, xref_ignore) == expected_result
def generate_rows(param_types): for param_type in sorted(set(param_types)): xref = make_xref(param_type, xref_aliases, xref_ignore) row = (f'- {param_type}\n- {xref}', ) yield row
def test_xref_ignore_is_all(): with pytest.raises(TypeError, match="must be a set or 'all'"): make_xref("array_like", xref_aliases, xref_ignore="foo")
def test_make_xref(): for s in data.strip().split('\n\n'): param_type, expected_result = s.split('\n') result = make_xref(param_type, xref_aliases, xref_ignore) assert result == expected_result
def test_make_xref_ignore_unknown(param_type, expected_result): assert make_xref(param_type, xref_aliases, xref_ignore="all") == expected_result