Skip to content

Commit c900256

Browse files
committed
Various pyflakes fixes
1 parent f52f4fd commit c900256

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
.PHONY: clean-pyc ext-test test upload-docs docs
1+
.PHONY: clean-pyc ext-test test upload-docs docs audit
22

33
all: clean-pyc test
44

55
test:
66
python setup.py test
77

8+
audit:
9+
python setup.py audit
10+
811
tox-test:
912
PYTHONDONTWRITEBYTECODE= tox
1013

tests/flask_tests.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
import sys
1616
import flask
1717
import unittest
18-
import tempfile
1918
from logging import StreamHandler
2019
from contextlib import contextmanager
2120
from datetime import datetime
22-
from werkzeug import parse_date, parse_options_header, http_date
21+
from werkzeug import parse_date, parse_options_header
2322
from werkzeug.exceptions import NotFound
2423
from jinja2 import TemplateNotFound
2524
from cStringIO import StringIO
@@ -352,7 +351,7 @@ def after1(response):
352351
called.append(4)
353352
return response
354353
@app.after_request
355-
def after1(response):
354+
def after2(response):
356355
called.append(3)
357356
return response
358357
@app.route('/')
@@ -638,13 +637,13 @@ def test_basic_module(self):
638637
app = flask.Flask(__name__)
639638
admin = flask.Module(__name__, 'admin', url_prefix='/admin')
640639
@admin.route('/')
641-
def index():
640+
def admin_index():
642641
return 'admin index'
643642
@admin.route('/login')
644-
def login():
643+
def admin_login():
645644
return 'admin login'
646645
@admin.route('/logout')
647-
def logout():
646+
def admin_logout():
648647
return 'admin logout'
649648
@app.route('/')
650649
def index():
@@ -680,7 +679,7 @@ def after_admin_request(response):
680679
catched.append('after-admin')
681680
return response
682681
@admin.route('/')
683-
def index():
682+
def admin_index():
684683
return 'the admin'
685684
@app.before_request
686685
def before_request():
@@ -719,7 +718,7 @@ def inject_all_module():
719718
def index():
720719
return flask.render_template_string('{{ a }}{{ b }}{{ c }}')
721720
@admin.route('/')
722-
def index():
721+
def admin_index():
723722
return flask.render_template_string('{{ a }}{{ b }}{{ c }}')
724723
app.register_module(admin)
725724
c = app.test_client()
@@ -794,13 +793,13 @@ def test_safe_access(self):
794793
f = app.view_functions['admin.static']
795794

796795
try:
797-
rv = f('/etc/passwd')
796+
f('/etc/passwd')
798797
except NotFound:
799798
pass
800799
else:
801800
assert 0, 'expected exception'
802801
try:
803-
rv = f('../__init__.py')
802+
f('../__init__.py')
804803
except NotFound:
805804
pass
806805
else:
@@ -914,7 +913,7 @@ def exc():
914913
c = app.test_client()
915914

916915
with catch_stderr() as err:
917-
rv = c.get('/')
916+
c.get('/')
918917
out = err.getvalue()
919918
assert 'WARNING in flask_tests [' in out
920919
assert 'flask_tests.py' in out
@@ -1098,7 +1097,7 @@ def record(sender, template, context):
10981097

10991098
flask.template_rendered.connect(record, app)
11001099
try:
1101-
rv = app.test_client().get('/')
1100+
app.test_client().get('/')
11021101
assert len(recorded) == 1
11031102
template, context = recorded[0]
11041103
assert template.name == 'simple_template.html'

tests/flaskext_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import tempfile
1919
import subprocess
2020
import argparse
21-
from cStringIO import StringIO
2221

2322
from flask import json
2423

0 commit comments

Comments
 (0)