File: test_extension.py

package info (click to toggle)
sphinx-removed-in 0.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 116 kB
  • sloc: python: 75; makefile: 30; sh: 17
file content (21 lines) | stat: -rw-r--r-- 612 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
import os
import sys
import pytest


PARENT = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
sys.path.insert(0, PARENT)


@pytest.mark.sphinx(buildername='html', srcdir=os.path.join(PARENT, 'docs'))
def test_sphinx_build(app, status, warning):
    app.build()
    try:
        html = (app.outdir / 'index.html').read_text()
    except AttributeError:
        # an older version of sphinx (used e.g. on Python 2)
        # use the now deprecated API instead
        html = (app.outdir / 'index.html').text()

    assert 'Removed in version 1.2' in html
    assert 'Removed in version 3.2' in html