File: bench_core.py

package info (click to toggle)
markdown-it-py 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,780 kB
  • sloc: python: 5,214; xml: 39; sh: 29; makefile: 24
file content (20 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from pathlib import Path

import pytest

import markdown_it


@pytest.fixture
def spec_text():
    return Path(__file__).parent.joinpath("samples", "spec.md").read_text()


@pytest.fixture
def parser():
    return markdown_it.MarkdownIt("commonmark")


@pytest.mark.benchmark(group="core")
def test_spec(benchmark, parser, spec_text):
    benchmark(parser.render, spec_text)