From 5e9be25784a2a0339aa9c64e9cf8e4faf72e6ee3 Mon Sep 17 00:00:00 2001 From: Jeff Hammel Date: Thu, 19 Dec 2013 19:17:21 -0800 Subject: fix test failures on python3 save for unicode --- docs/index.txt | 4 ++-- tests/test_template.txt | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/index.txt b/docs/index.txt index a44ae57..a6cfd05 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -286,10 +286,10 @@ lets you use attributes:: >>> bunch = tempita.bunch(a=1) >>> bunch.a 1 - >>> bunch.items() + >>> list(bunch.items()) [('a', 1)] >>> bunch.default = None - >>> print bunch.b + >>> print (bunch.b) None This can be nice for passing options into a template. diff --git a/tests/test_template.txt b/tests/test_template.txt index 447367b..868c1e8 100644 --- a/tests/test_template.txt +++ b/tests/test_template.txt @@ -107,8 +107,8 @@ in Python, but it's more useful in templates generally):: ... elif item == 'orange': ... assert loop.last ... if loop.first_group(lambda i: i[0].upper()): - ... print '%s:' % item[0].upper() - ... print loop.number, item + ... print ('%s:' % item[0].upper()) + ... print (loop.number, item) A: 1 apple 2 asparagus @@ -167,24 +167,24 @@ Then we'll define a template that inherits:: ... This is the parent {{master}}. The block: {{self.block}} ... Then the body: {{self.body}} ... ''') - >>> print tmpl.substitute(master='test').strip() + >>> print (tmpl.substitute(master='test').strip()) This is the parent test. The block: some text Then the body: Hi there! >>> tmpl2 = Template('''\ ... {{def block(arg='hi_'+master):}}hey {{master}}: {{arg}}{{enddef}} ... ''', get_template=get_template, default_inherit='super_test') - >>> print tmpl2.substitute(master='test2').strip() + >>> print (tmpl2.substitute(master='test2').strip()) This is the parent test2. The block: hey test2: hi_test2 Then the body: >>> super_test = Template('''\ ... The block: {{self.block('blah')}} ... ''') - >>> print tmpl2.substitute(master='test2').strip() + >>> print (tmpl2.substitute(master='test2').strip()) The block: hey test2: blah >>> super_test = Template('''\ ... Something: {{self.get.something('hi')}} ... ''') - >>> print tmpl2.substitute(master='test2').strip() + >>> print (tmpl2.substitute(master='test2').strip()) Something: Whitespace @@ -204,7 +204,7 @@ itself. For example:: ... {{item}} ... ... {{endfor}}''') - >>> print tmpl.substitute() + >>> print (tmpl.substitute())
a
-- cgit v1.2.1