Reimplement assert_in and assert_not_in, they are not in nose in Py2.6.

This commit is contained in:
Georg Brandl 2014-09-21 18:48:21 +02:00
parent 70cf797c10
commit fa91f19e55

View File

@ -16,7 +16,7 @@ import re
from subprocess import Popen, PIPE
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 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)
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):
default_kw = {
'testroot': 'intl',
@ -299,7 +309,6 @@ def test_text_builder(app, status, warning):
yield assert_in, d.upper() + " BODY", result
@gen_with_intl_app('html', freshenv=True)
def test_html_builder(app, status, warning):
app.builder.build_all()