diff options
author | Jeff Hammel <jhammel@mozilla.com> | 2013-12-19 19:17:21 -0800 |
---|---|---|
committer | Jeff Hammel <jhammel@mozilla.com> | 2013-12-19 19:17:21 -0800 |
commit | 5e9be25784a2a0339aa9c64e9cf8e4faf72e6ee3 (patch) | |
tree | c7c3e3e23e00840984886a0c1b42694ef387ee8d | |
parent | dc9526510b75c377c47b6b0ec89efd4d0f469007 (diff) | |
download | tempita-5e9be25784a2a0339aa9c64e9cf8e4faf72e6ee3.tar.gz |
fix test failures on python3 save for unicode
-rw-r--r-- | docs/index.txt | 4 | ||||
-rw-r--r-- | 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}} ... </div> ... {{endfor}}''') - >>> print tmpl.substitute() + >>> print (tmpl.substitute()) <div class='even'> a </div> |