Commits

Florent Xicluna  committed be5202c

Fix typo, remove useless import, limit lines to 79 columns.

  • Participants
  • Parent commits d135da6

Comments (0)

Files changed (2)

 
 
 class Session(SecureCookie):
-    """Expands the session for support for switching between permanent
+    """Expands the session with support for switching between permanent
     and non-permanent sessions.
     """
 
     def _get_permanent(self):
         return self.get('_permanent', False)
+
     def _set_permanent(self, value):
         self['_permanent'] = bool(value)
+
     permanent = property(_get_permanent, _set_permanent)
     del _get_permanent, _set_permanent
 
         #: decorator.
         self.after_request_funcs = []
 
-        #: a list of functions that are called without arguments
+        #: a list of functions that are called without argument
         #: to populate the template context.  Each returns a dictionary
         #: that the template context is updated with.
         #: To register a function here, use the :meth:`context_processor`

File tests/flask_tests.py

 import flask
 import unittest
 import tempfile
-import warnings
 from datetime import datetime
 from werkzeug import parse_date
 
         assert sorted(rv.allow) == ['GET', 'HEAD']
         rv = c.head('/')
         assert rv.status_code == 200
-        assert not rv.data # head truncates
+        assert not rv.data  # head truncates
         assert c.post('/more').data == 'POST'
         assert c.get('/more').data == 'GET'
         rv = c.delete('/more')
         assert sorted(rv.allow) == ['GET', 'HEAD']
         rv = c.head('/')
         assert rv.status_code == 200
-        assert not rv.data # head truncates
+        assert not rv.data  # head truncates
         assert c.post('/more').data == 'POST'
         assert c.get('/more').data == 'GET'
         rv = c.delete('/more')
             flask.abort(404)
         @app.route('/error')
         def error():
-            1/0
+            1 // 0
         c = app.test_client()
         rv = c.get('/')
         assert rv.status_code == 404
             def to_python(self, value):
                 return value.split(',')
             def to_url(self, value):
-                return ','.join(super(ListConverter, self).to_url(x) for x in value)
+                base_to_url = super(ListConverter, self).to_url
+                return ','.join(base_to_url(x) for x in value)
         app = flask.Flask(__name__)
         app.url_map.converters['list'] = ListConverter
         @app.route('/<list:args>')
 
     def test_template_escaping(self):
         app = flask.Flask(__name__)
+        render = flask.render_template_string
         with app.test_request_context():
-            rv = flask.render_template_string('{{ "</script>"|tojson|safe }}')
+            rv = render('{{ "</script>"|tojson|safe }}')
             assert rv == '"<\\/script>"'
-            rv = flask.render_template_string('{{ "<\0/script>"|tojson|safe }}')
+            rv = render('{{ "<\0/script>"|tojson|safe }}')
             assert rv == '"<\\u0000\\/script>"'