File: test_noextra.py

package info (click to toggle)
python-readme-renderer 44.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 728 kB
  • sloc: python: 414; sh: 23; makefile: 6
file content (15 lines) | stat: -rwxr-xr-x 520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pytest

from readme_renderer.markdown import render, variants


@pytest.mark.skipif(variants, reason="Extra is installed")
@pytest.mark.parametrize("variant", ('GFM', 'CommonMark'))
def test_no_extra(variant):
    with pytest.warns(UserWarning) as warnings:
        assert render('Hello', variant=variant) is None
    assert len(warnings) == 1
    assert warnings[0].message.args[0] == (
        "Markdown renderers are not available. "
        "Install 'readme_renderer[md]' to enable Markdown rendering."
    )