From fa91f19e5513e5a694472d657d6463ee4b21b231 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 21 Sep 2014 18:48:21 +0200 Subject: [PATCH] Reimplement assert_in and assert_not_in, they are not in nose in Py2.6. --- tests/test_intl.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_intl.py b/tests/test_intl.py index bbcf93eba..19d7189aa 100644 --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -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()