diff --git a/tests/test_ext_todo.py b/tests/test_ext_todo.py index 3fca33f6f..b53ac3f72 100644 --- a/tests/test_ext_todo.py +++ b/tests/test_ext_todo.py @@ -30,23 +30,19 @@ def test_todo(app, status, warning): # check todolist content = (app.outdir / 'index.html').text() - html = ('

Todo

\n' - '

todo in foo

') - assert re.search(html, content, re.S) + assert ('

Todo

\n' + '

todo in foo

') in content - html = ('

Todo

\n' - '

todo in bar

') - assert re.search(html, content, re.S) + assert ('

Todo

\n' + '

todo in bar

') in content # check todo content = (app.outdir / 'foo.html').text() - html = ('

Todo

\n' - '

todo in foo

') - assert re.search(html, content, re.S) + assert ('

Todo

\n' + '

todo in foo

') in content - html = ('

Todo

\n' - '

todo in param field

') - assert re.search(html, content, re.S) + assert ('

Todo

\n' + '

todo in param field

') in content # check emitted warnings assert 'WARNING: TODO entry found: todo in foo' in warning.getvalue() @@ -72,19 +68,16 @@ def test_todo_not_included(app, status, warning): # check todolist content = (app.outdir / 'index.html').text() - html = ('

Todo

\n' - '

todo in foo

') - assert not re.search(html, content, re.S) + assert ('

Todo

\n' + '

todo in foo

') not in content - html = ('

Todo

\n' - '

todo in bar

') - assert not re.search(html, content, re.S) + assert ('

Todo

\n' + '

todo in bar

') not in content # check todo content = (app.outdir / 'foo.html').text() - html = ('

Todo

\n' - '

todo in foo

') - assert not re.search(html, content, re.S) + assert ('

Todo

\n' + '

todo in foo

') not in content # check emitted warnings assert 'WARNING: TODO entry found: todo in foo' in warning.getvalue() @@ -114,8 +107,8 @@ def test_todo_valid_link(app, status, warning): # Look for the link to foo. Note that there are two of them because the # source document uses todolist twice. We could equally well look for links # to bar. - link = r'\{\\hyperref\[\\detokenize\{(.*?foo.*?)}]\{\\sphinxcrossref{' \ - r'\\sphinxstyleemphasis{original entry}}}}' + link = (r'\{\\hyperref\[\\detokenize\{(.*?foo.*?)}]\{\\sphinxcrossref{' + r'\\sphinxstyleemphasis{original entry}}}}') m = re.findall(link, content) assert len(m) == 4 target = m[0]