Skip to content

Commit

Permalink
test(doc2test): Test for eval-rst blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jul 12, 2022
1 parent 015d7bc commit 6e6d21a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_doc2test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import doctest
import os
import textwrap
from typing import Literal

import pytest

Expand Down Expand Up @@ -87,9 +88,10 @@ def test_indented():
assert example.lineno == 7


def test_cartopy():
@pytest.mark.parametrize("file_type", ["rst", "md"])
def test_cartopy(file_type: Literal['rst', 'md']):
rstpath = os.path.join(
os.path.dirname(__file__), "testdata", "using_the_shapereader.rst"
os.path.dirname(__file__), "testdata", f"using_the_shapereader.{file_type}"
)
with open(rstpath, "r") as fh:
sections = get_sections(fh.read())
Expand Down

0 comments on commit 6e6d21a

Please sign in to comment.