77import pytest
88
99
10- RESOURCE_DIR = pathlib .Path (__file__ ).parent .absolute ()
10+ RESOURCE_DIR = pathlib .Path (__file__ ).parent .absolute () / "resources"
1111
1212
1313@pytest .fixture (scope = "module" )
@@ -23,14 +23,14 @@ def markdown_include_inherit_heading_depth():
2323
2424
2525def test_single_include (markdown_include ):
26- source = "{!resources/ simple.md!}"
26+ source = "{!simple.md!}"
2727 html = markdown .markdown (source , extensions = [markdown_include ])
2828
2929 assert html == "<p>This is a simple template</p>"
3030
3131
3232def test_double_include (markdown_include ):
33- source = "{!resources/ simple.md!} and {!resources/ simple_2.md!}"
33+ source = "{!simple.md!} and {!simple_2.md!}"
3434 html = markdown .markdown (source , extensions = [markdown_include ])
3535
3636 assert (
@@ -42,9 +42,9 @@ def test_headers(markdown_include):
4242 source = (
4343 "Source file\n "
4444 "# Heading Level 1 of main file\n "
45- "{!resources/ header.md!}\n "
45+ "{!header.md!}\n "
4646 "## Heading Level 2 of main file\n "
47- "{!resources/ header.md!}"
47+ "{!header.md!}"
4848 )
4949
5050 html = markdown .markdown (source , extensions = [markdown_include ])
@@ -64,7 +64,7 @@ def test_headers(markdown_include):
6464
6565
6666def test_embedded_template (markdown_include ):
67- source = "{!resources/ template_inside.md!}"
67+ source = "{!template_inside.md!}"
6868 html = markdown .markdown (source , extensions = [markdown_include ])
6969
7070 assert (
@@ -74,7 +74,7 @@ def test_embedded_template(markdown_include):
7474
7575
7676def test_single_include_inherit_heading_depth (markdown_include_inherit_heading_depth ):
77- source = "{!resources/ simple.md!}"
77+ source = "{!simple.md!}"
7878 html = markdown .markdown (
7979 source , extensions = [markdown_include_inherit_heading_depth ]
8080 )
@@ -83,7 +83,7 @@ def test_single_include_inherit_heading_depth(markdown_include_inherit_heading_d
8383
8484
8585def test_double_include_inherit_heading_depth (markdown_include_inherit_heading_depth ):
86- source = "{!resources/ simple.md!} and {!resources/ simple_2.md!}"
86+ source = "{!simple.md!} and {!simple_2.md!}"
8787 html = markdown .markdown (
8888 source , extensions = [markdown_include_inherit_heading_depth ]
8989 )
@@ -97,9 +97,9 @@ def test_headers_inherit_heading_depth(markdown_include_inherit_heading_depth):
9797 source = (
9898 "Source file\n "
9999 "# Heading Level 1 of main file\n "
100- "{!resources/ header.md!}\n "
100+ "{!header.md!}\n "
101101 "## Heading Level 2 of main file\n "
102- "{!resources/ header.md!}"
102+ "{!header.md!}"
103103 )
104104
105105 html = markdown .markdown (
@@ -111,12 +111,12 @@ def test_headers_inherit_heading_depth(markdown_include_inherit_heading_depth):
111111 <p>Source file</p>
112112 <h1>Heading Level 1 of main file</h1>
113113 <h2>This heading will be one level deeper from the previous heading</h2>
114- <p>More included file content.</p>
115- <p> End of included content.</p>
114+ <p>More included file content.
115+ End of included content.</p>
116116 <h2>Heading Level 2 of main file</h2>
117117 <h3>This heading will be one level deeper from the previous heading</h3>
118- <p>More included file content.</p>
119- <p> End of included content.</p>"""
118+ <p>More included file content.
119+ End of included content.</p>"""
120120 )
121121
122122
@@ -135,17 +135,17 @@ def test_processor_lines():
135135 source = [
136136 "Source file" ,
137137 "# Heading Level 1 of main file" ,
138- "{!resources/ header.md!}" ,
138+ "{!header.md!}" ,
139139 "## Heading Level 2 of main file" ,
140- "{!resources/ header.md!}" ,
140+ "{!header.md!}" ,
141141 ]
142142 result_lines = processor .run (source )
143143
144144 assert len (result_lines ) == 9
145145
146146
147147def test_include_lines (markdown_include ):
148- source = "{!resources/ longer.md!lines=1 3}"
148+ source = "{!longer.md!lines=1 3}"
149149 html = markdown .markdown (source , extensions = [markdown_include ])
150150
151151 assert html == dedent (
@@ -156,7 +156,7 @@ def test_include_lines(markdown_include):
156156
157157
158158def test_include_line_range (markdown_include ):
159- source = "{!resources/ longer.md!lines=3-5}"
159+ source = "{!longer.md!lines=3-5}"
160160 html = markdown .markdown (source , extensions = [markdown_include ])
161161
162162 assert html == dedent (
@@ -168,7 +168,7 @@ def test_include_line_range(markdown_include):
168168
169169
170170def test_include_lines_and_line_range (markdown_include ):
171- source = "{!resources/ longer.md!lines=1 3-5 8}"
171+ source = "{!longer.md!lines=1 3-5 8}"
172172 html = markdown .markdown (source , extensions = [markdown_include ])
173173
174174 assert html == dedent (
@@ -182,11 +182,20 @@ def test_include_lines_and_line_range(markdown_include):
182182
183183
184184def test_include_lines_out_of_order (markdown_include ):
185- source = "{!resources/ longer.md!lines=3 1}"
185+ source = "{!longer.md!lines=3 1}"
186186 html = markdown .markdown (source , extensions = [markdown_include ])
187187
188188 assert html == dedent (
189189 """\
190190 <p>This is line 3
191191 This is line 1</p>"""
192192 )
193+
194+
195+ def test_nested_table (markdown_include_inherit_heading_depth ):
196+ source = "{!table_inner.md!}"
197+ html = markdown .markdown (
198+ source , extensions = [markdown_include_inherit_heading_depth , "tables" ]
199+ )
200+
201+ assert "<table>" in html
0 commit comments