From c3e615dfa3b1aadf5702a970226bd783368d53cc Mon Sep 17 00:00:00 2001 From: Raphael Pierzina Date: Thu, 9 Apr 2015 00:38:57 +0200 Subject: [PATCH] Remove the test class from test_jinja.py --- tests/utils/test_jinja.py | 51 ++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/tests/utils/test_jinja.py b/tests/utils/test_jinja.py index b56d1cf83..ad04061e4 100644 --- a/tests/utils/test_jinja.py +++ b/tests/utils/test_jinja.py @@ -32,34 +32,31 @@ def _read_file(path): raise ValueError("Invalid path {}!".format(path)) -class JinjaTests(object): +def test_simple_template(monkeypatch): + """Test with a simple template.""" + monkeypatch.setattr( + 'qutebrowser.utils.jinja.utils.read_file', + _read_file + ) + template = jinja.env.get_template('test.html') + # https://bitbucket.org/logilab/pylint/issue/490/ + data = template.render(var='World') # pylint: disable=no-member + assert data == "Hello World" - """Tests for getting template via jinja.""" - def test_simple_template(self, monkeypatch): - """Test with a simple template.""" - monkeypatch.setattr( - 'qutebrowser.utils.jinja.utils.read_file', - _read_file - ) - template = jinja.env.get_template('test.html') - # https://bitbucket.org/logilab/pylint/issue/490/ - data = template.render(var='World') # pylint: disable=no-member - assert data == "Hello World" +def test_utf8(monkeypatch): + """Test rendering with an UTF8 template. - def test_utf8(self, monkeypatch): - """Test rendering with an UTF8 template. + This was an attempt to get a failing test case for #127 but it seems + the issue is elsewhere. - This was an attempt to get a failing test case for #127 but it seems - the issue is elsewhere. - - https://github.com/The-Compiler/qutebrowser/issues/127 - """ - monkeypatch.setattr( - 'qutebrowser.utils.jinja.utils.read_file', - _read_file - ) - template = jinja.env.get_template('test.html') - # https://bitbucket.org/logilab/pylint/issue/490/ - data = template.render(var='\u2603') # pylint: disable=no-member - assert data == "Hello \u2603" + https://github.com/The-Compiler/qutebrowser/issues/127 + """ + monkeypatch.setattr( + 'qutebrowser.utils.jinja.utils.read_file', + _read_file + ) + template = jinja.env.get_template('test.html') + # https://bitbucket.org/logilab/pylint/issue/490/ + data = template.render(var='\u2603') # pylint: disable=no-member + assert data == "Hello \u2603"