File: test_comment_styles.py

package info (click to toggle)
pytest-codeblocks 0.17.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 180 kB
  • sloc: python: 699; makefile: 34
file content (27 lines) | stat: -rw-r--r-- 529 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pytest


@pytest.mark.parametrize(
    "comment",
    [
        "<!--pytest-codeblocks:cont-->",
        "<!---pytest-codeblocks:cont--->",
        "<!-- pytest-codeblocks:cont -->",
        "<!--- pytest-codeblocks:cont --->",
    ],
)
def test_cont(testdir, comment):
    string = """
    Lorem ipsum
    ```python
    a = 1
    ```
    dolor sit amet
    {comment}
    ```
    a + 1
    ```
    """
    testdir.makefile(".md", string)
    result = testdir.runpytest("--codeblocks")
    result.assert_outcomes(passed=1)