Skip to content

Commit c336965

Browse files
Chilippfunkyfuture
andcommitted
minor fix for tests
see #88 Co-authored-by: Frank Sachsenheim <funkyfuture@users.noreply.github.com> Co-authored-by: MeggyCal <MeggyCal@users.noreply.github.com>
1 parent 7009e5e commit c336965

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

tests/test_autodocsumm.py

+18-17
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
See the License for the specific language governing permissions and
1818
limitations under the License.
1919
"""
20+
import os.path as osp
2021
import re
2122
import bs4
2223
import pytest
@@ -36,7 +37,7 @@ def in_between(full, sub, s0, *others):
3637

3738

3839
def get_html(app, fname):
39-
with open(app.outdir + '/' + fname) as f:
40+
with open(osp.join(str(app.outdir), fname)) as f:
4041
return f.read()
4142

4243

@@ -207,7 +208,7 @@ def test_module_nosignatures(self, app):
207208

208209
def test_class(self, app):
209210
app.build()
210-
html = get_html(app, '/test_class.html')
211+
html = get_html(app, 'test_class.html')
211212

212213
if sphinx_version[:2] > [3, 1]:
213214
assert in_autosummary("instance_attribute", html)
@@ -259,7 +260,7 @@ def test_class(self, app):
259260
)
260261
def test_class_order(self, app):
261262
app.build()
262-
html = get_html(app, '/test_class_order.html')
263+
html = get_html(app, 'test_class_order.html')
263264

264265
if sphinx_version[:2] > [3, 1]:
265266
assert in_autosummary("instance_attribute", html)
@@ -276,7 +277,7 @@ def test_class_order(self, app):
276277

277278
def test_class_summary_only(self, app):
278279
app.build()
279-
html = get_html(app, '/test_class_summary_only.html')
280+
html = get_html(app, 'test_class_summary_only.html')
280281

281282
if sphinx_version[:2] > [3, 1]:
282283
assert in_autosummary("instance_attribute", html)
@@ -300,7 +301,7 @@ def test_class_summary_only(self, app):
300301

301302
def test_class_nosignatures(self, app):
302303
app.build()
303-
html = get_html(app, '/test_class_nosignatures.html')
304+
html = get_html(app, 'test_class_nosignatures.html')
304305

305306
if sphinx_version[:2] > [3, 1]:
306307
assert in_autosummary("instance_attribute", html)
@@ -326,7 +327,7 @@ def test_class_nosignatures(self, app):
326327

327328
def test_inherited(self, app):
328329
app.build()
329-
html = get_html(app, '/test_inherited.html')
330+
html = get_html(app, 'test_inherited.html')
330331
assert in_autosummary("test_method", html)
331332

332333
@pytest.mark.xfail
@@ -341,7 +342,7 @@ def test_autoclasssumm_inline(self, app):
341342
"""Test an AutoDocSummDirective inline."""
342343
app.build()
343344

344-
html = get_html(app, '/test_autoclasssumm_inline.html')
345+
html = get_html(app, 'test_autoclasssumm_inline.html')
345346

346347
methods_title = "<strong>Methods:</strong>"
347348

@@ -357,7 +358,7 @@ def test_autoclasssumm_inline(self, app):
357358
def test_class_submodule(self, app):
358359
app.build()
359360

360-
html = get_html(app, '/test_class_submodule.html')
361+
html = get_html(app, 'test_class_submodule.html')
361362

362363
# check that hyperlink for instance method exists in summary table
363364
assert re.findall(r'<td>.*href="#dummy_submodule\.submodule1'
@@ -366,7 +367,7 @@ def test_class_submodule(self, app):
366367
def test_module_submodule(self, app):
367368
app.build()
368369

369-
html = get_html(app, '/test_module_submodule.html')
370+
html = get_html(app, 'test_module_submodule.html')
370371

371372
# check that hyperlink for class exists in summary table
372373
assert re.findall(r'<td>.*href="#dummy_submodule\.submodule2'
@@ -384,7 +385,7 @@ def test_autoclasssumm(self, app):
384385
"""Test building the autosummary of a class."""
385386
app.build()
386387

387-
html = get_html(app, '/test_autoclasssumm.html')
388+
html = get_html(app, 'test_autoclasssumm.html')
388389

389390
# the class docstring must not be in the html
390391
assert "Class test for autosummary" not in html
@@ -397,7 +398,7 @@ def test_autoclasssumm_no_titles(self, app):
397398
"""Test building the autosummary of a class."""
398399
app.build()
399400

400-
html = get_html(app, '/test_autoclasssumm_no_titles.html')
401+
html = get_html(app, 'test_autoclasssumm_no_titles.html')
401402

402403
# the class docstring must not be in the html
403404
assert "Class test for autosummary" not in html
@@ -412,7 +413,7 @@ def test_autoclasssumm_some_sections(self, app):
412413
"""Test building the autosummary of a class with some sections only."""
413414
app.build()
414415

415-
html = get_html(app, '/test_autoclasssumm_some_sections.html')
416+
html = get_html(app, 'test_autoclasssumm_some_sections.html')
416417

417418
# the class docstring must not be in the html
418419
assert "Class test for autosummary" not in html
@@ -426,7 +427,7 @@ def test_autoclasssumm_nosignatures(self, app):
426427
"""Test building the autosummary of a class without signatures."""
427428
app.build()
428429

429-
html = get_html(app, '/test_autoclasssumm_nosignatures.html')
430+
html = get_html(app, 'test_autoclasssumm_nosignatures.html')
430431

431432
# the class docstring must not be in the html
432433
assert "Class test for autosummary" not in html
@@ -441,7 +442,7 @@ def test_automodulesumm(self, app):
441442
"""Test building the autosummary of a module."""
442443
app.build()
443444

444-
html = get_html(app, '/test_automodulesumm.html')
445+
html = get_html(app, 'test_automodulesumm.html')
445446

446447
# the class docstring must not be in the html
447448
assert "Module for testing the autodocsumm" not in html
@@ -455,7 +456,7 @@ def test_automodulesumm_some_sections(self, app):
455456
"""Test building the autosummary of a module with some sections only."""
456457
app.build()
457458

458-
html = get_html(app, '/test_automodulesumm_some_sections.html')
459+
html = get_html(app, 'test_automodulesumm_some_sections.html')
459460

460461
# the class docstring must not be in the html
461462
assert "Module for testing the autodocsumm" not in html
@@ -469,7 +470,7 @@ def test_automodulesumm_nosignatures(self, app):
469470
"""Test building the autosummary of a module without signatures."""
470471
app.build()
471472

472-
html = get_html(app, '/test_automodulesumm_nosignatures.html')
473+
html = get_html(app, 'test_automodulesumm_nosignatures.html')
473474

474475
# the class docstring must not be in the html
475476
assert "Module for testing the autodocsumm" not in html
@@ -484,6 +485,6 @@ def test_automodulesumm_nosignatures(self, app):
484485
def test_empty(self, app):
485486
app.build()
486487

487-
html = get_html(app, '/test_empty.html')
488+
html = get_html(app, 'test_empty.html')
488489

489490
assert not in_autosummary("product", html)

0 commit comments

Comments
 (0)