diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-13 21:29:57 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-13 21:29:57 -0400 |
commit | c16198a494de2227e05708cb4ffac4da43dc3779 (patch) | |
tree | 7aa792a5b11f94559a7eaf421a6fe4441bd79bdc /test/test_template.py | |
parent | 6c5e273c3b36606ac7267b5fe3ec77cb0c47da52 (diff) | |
download | external_python_mako-c16198a494de2227e05708cb4ffac4da43dc3779.tar.gz external_python_mako-c16198a494de2227e05708cb4ffac4da43dc3779.tar.bz2 external_python_mako-c16198a494de2227e05708cb4ffac4da43dc3779.zip |
- [bug] Cleaned up all the various deprecation/
file warnings when running the tests under
various Pythons with warnings turned on.
[ticket:213]
Diffstat (limited to 'test/test_template.py')
-rw-r--r-- | test/test_template.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_template.py b/test/test_template.py index 25b2fae..28db06d 100644 --- a/test/test_template.py +++ b/test/test_template.py @@ -5,6 +5,7 @@ from mako.lookup import TemplateLookup from mako.ext.preprocessors import convert_comments from mako import exceptions, runtime from mako import compat +from mako import util import os from test.util import flatten_result, result_lines from mako.compat import u @@ -219,7 +220,7 @@ class EncodingTest(TemplateTest): ) self._do_memory_test( - open(self._file_path("unicode_arguments.html"), 'rb').read(), + util.read_file(self._file_path("unicode_arguments.html")), [ u('x is: drôle de petite voix m’a réveillé'), u('x is: drôle de petite voix m’a réveillé'), @@ -1017,16 +1018,16 @@ class RichTracebackTest(TemplateTest): source = source.encode('utf-8') else: source = source - templateargs = {'text':source} + templateargs = {'text': source} else: if syntax: filename = 'unicode_syntax_error.html' else: filename = 'unicode_runtime_error.html' - source = open(self._file_path(filename), 'rb').read() + source = util.read_file(self._file_path(filename), 'rb') if not utf8: source = source.decode('utf-8') - templateargs = {'filename':self._file_path(filename)} + templateargs = {'filename': self._file_path(filename)} try: template = Template(**templateargs) if not syntax: |