Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Various pyflakes fixes

  • Loading branch information...
commit c9002569c9abfa715e491aa636555e51ddf85d50 1 parent f52f4fd
@mitsuhiko authored
Showing with 15 additions and 14 deletions.
  1. +4 −1 Makefile
  2. +11 −12 tests/flask_tests.py
  3. +0 −1  tests/flaskext_test.py
View
5 Makefile
@@ -1,10 +1,13 @@
-.PHONY: clean-pyc ext-test test upload-docs docs
+.PHONY: clean-pyc ext-test test upload-docs docs audit
all: clean-pyc test
test:
python setup.py test
+audit:
+ python setup.py audit
+
tox-test:
PYTHONDONTWRITEBYTECODE= tox
View
23 tests/flask_tests.py
@@ -15,11 +15,10 @@
import sys
import flask
import unittest
-import tempfile
from logging import StreamHandler
from contextlib import contextmanager
from datetime import datetime
-from werkzeug import parse_date, parse_options_header, http_date
+from werkzeug import parse_date, parse_options_header
from werkzeug.exceptions import NotFound
from jinja2 import TemplateNotFound
from cStringIO import StringIO
@@ -352,7 +351,7 @@ def after1(response):
called.append(4)
return response
@app.after_request
- def after1(response):
+ def after2(response):
called.append(3)
return response
@app.route('/')
@@ -638,13 +637,13 @@ def test_basic_module(self):
app = flask.Flask(__name__)
admin = flask.Module(__name__, 'admin', url_prefix='/admin')
@admin.route('/')
- def index():
+ def admin_index():
return 'admin index'
@admin.route('/login')
- def login():
+ def admin_login():
return 'admin login'
@admin.route('/logout')
- def logout():
+ def admin_logout():
return 'admin logout'
@app.route('/')
def index():
@@ -680,7 +679,7 @@ def after_admin_request(response):
catched.append('after-admin')
return response
@admin.route('/')
- def index():
+ def admin_index():
return 'the admin'
@app.before_request
def before_request():
@@ -719,7 +718,7 @@ def inject_all_module():
def index():
return flask.render_template_string('{{ a }}{{ b }}{{ c }}')
@admin.route('/')
- def index():
+ def admin_index():
return flask.render_template_string('{{ a }}{{ b }}{{ c }}')
app.register_module(admin)
c = app.test_client()
@@ -794,13 +793,13 @@ def test_safe_access(self):
f = app.view_functions['admin.static']
try:
- rv = f('/etc/passwd')
+ f('/etc/passwd')
except NotFound:
pass
else:
assert 0, 'expected exception'
try:
- rv = f('../__init__.py')
+ f('../__init__.py')
except NotFound:
pass
else:
@@ -914,7 +913,7 @@ def exc():
c = app.test_client()
with catch_stderr() as err:
- rv = c.get('/')
+ c.get('/')
out = err.getvalue()
assert 'WARNING in flask_tests [' in out
assert 'flask_tests.py' in out
@@ -1098,7 +1097,7 @@ def record(sender, template, context):
flask.template_rendered.connect(record, app)
try:
- rv = app.test_client().get('/')
+ app.test_client().get('/')
assert len(recorded) == 1
template, context = recorded[0]
assert template.name == 'simple_template.html'
View
1  tests/flaskext_test.py
@@ -18,7 +18,6 @@
import tempfile
import subprocess
import argparse
-from cStringIO import StringIO
from flask import json
Please sign in to comment.
Something went wrong with that request. Please try again.