mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Reimplement assert_in and assert_not_in, they are not in nose in Py2.6.
This commit is contained in:
parent
70cf797c10
commit
fa91f19e55
@ -16,7 +16,7 @@ import re
|
|||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
from xml.etree import ElementTree
|
from xml.etree import ElementTree
|
||||||
|
|
||||||
from nose.tools import assert_equal, assert_in, assert_not_in
|
from nose.tools import assert_equal
|
||||||
from six import string_types
|
from six import string_types
|
||||||
|
|
||||||
from util import tempdir, rootdir, path, gen_with_app, SkipTest
|
from util import tempdir, rootdir, path, gen_with_app, SkipTest
|
||||||
@ -40,6 +40,16 @@ def startswith(thing, prefix):
|
|||||||
assert False, '%r does not start with %r' % (thing, prefix)
|
assert False, '%r does not start with %r' % (thing, prefix)
|
||||||
|
|
||||||
|
|
||||||
|
def assert_in(x, thing):
|
||||||
|
if x not in thing:
|
||||||
|
assert False, '%r is not in %r' % (x, thing)
|
||||||
|
|
||||||
|
|
||||||
|
def assert_not_in(x, thing):
|
||||||
|
if x in thing:
|
||||||
|
assert False, '%r is in %r' % (x, thing)
|
||||||
|
|
||||||
|
|
||||||
def gen_with_intl_app(*args, **kw):
|
def gen_with_intl_app(*args, **kw):
|
||||||
default_kw = {
|
default_kw = {
|
||||||
'testroot': 'intl',
|
'testroot': 'intl',
|
||||||
@ -299,7 +309,6 @@ def test_text_builder(app, status, warning):
|
|||||||
yield assert_in, d.upper() + " BODY", result
|
yield assert_in, d.upper() + " BODY", result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@gen_with_intl_app('html', freshenv=True)
|
@gen_with_intl_app('html', freshenv=True)
|
||||||
def test_html_builder(app, status, warning):
|
def test_html_builder(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
Loading…
Reference in New Issue
Block a user