Various pyflakes fixes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent f52f4fd · Browse files · 3 files·+15 added−14 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+15 added−14 removed
- tests:+11 added−13 removed
- other:+4 added−1 removed
Provenance
- Commit
c900256- Tree
2c4b525- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
f52f4fd
3 files changed+15 added−14 removed
modified:tests/flask_tests.py+11 added-12 removed
13 unmodified lines14 import re15 import sys16 import flask17 import unittest18-import tempfile18 from logging import StreamHandler19 from contextlib import contextmanager20 from datetime import datetime22-from werkzeug import parse_date, parse_options_header, http_date21+from werkzeug import parse_date, parse_options_header22 from werkzeug.exceptions import NotFound23 from jinja2 import TemplateNotFound24 from cStringIO import StringIO25 324 unmodified lines350 def after1(response):351 called.append(4)352 return response353 @app.after_request355- def after1(response):354+ def after2(response):355 called.append(3)356 return response357 @app.route('/')358 def index():277 unmodified lines636 def test_basic_module(self):637 app = flask.Flask(__name__)638 admin = flask.Module(__name__, 'admin', url_prefix='/admin')639 @admin.route('/')641- def index():640+ def admin_index():641 return 'admin index'642 @admin.route('/login')644- def login():643+ def admin_login():644 return 'admin login'645 @admin.route('/logout')647- def logout():646+ def admin_logout():647 return 'admin logout'648 @app.route('/')649 def index():650 return 'the index'27 unmodified lines678 def after_admin_request(response):679 catched.append('after-admin')680 return response681 @admin.route('/')683- def index():682+ def admin_index():683 return 'the admin'684 @app.before_request685 def before_request():686 catched.append('before-app')30 unmodified lines717 @app.route('/')718 def index():719 return flask.render_template_string('{{ a }}{{ b }}{{ c }}')720 @admin.route('/')722- def index():721+ def admin_index():722 return flask.render_template_string('{{ a }}{{ b }}{{ c }}')723 app.register_module(admin)724 c = app.test_client()725 assert c.get('/').data == '13'66 unmodified lines792 with app.test_request_context():793 f = app.view_functions['admin.static']794 795 try:797- rv = f('/etc/passwd')796+ f('/etc/passwd')797 except NotFound:798 pass799 else:800 assert 0, 'expected exception'801 try:803- rv = f('../__init__.py')802+ f('../__init__.py')803 except NotFound:804 pass805 else:806 assert 0, 'expected exception'105 unmodified lines912 1/0913 c = app.test_client()914 915 with catch_stderr() as err:917- rv = c.get('/')916+ c.get('/')917 out = err.getvalue()918 assert 'WARNING in flask_tests [' in out919 assert 'flask_tests.py' in out920 assert 'the standard library is dead' in out175 unmodified lines1096 recorded.append((template, context))1097 1098 flask.template_rendered.connect(record, app)1099 try:1101- rv = app.test_client().get('/')1100+ app.test_client().get('/')1101 assert len(recorded) == 11102 template, context = recorded[0]1103 assert template.name == 'simple_template.html'1104 assert context['whiskey'] == 4286 unmodified linesmodified:tests/flaskext_test.py-1 removed
16 unmodified lines17 import urllib218 import tempfile19 import subprocess20 import argparse21-from cStringIO import StringIO21 22 from flask import json23 24 from setuptools.package_index import PackageIndex286 unmodified linesmodified:Makefile+4 added-1 removed
1-.PHONY: clean-pyc ext-test test upload-docs docs1+.PHONY: clean-pyc ext-test test upload-docs docs audit2 3 all: clean-pyc test4 5 test:6 python setup.py test7 8+audit:9+ python setup.py audit10+11 tox-test:12 PYTHONDONTWRITEBYTECODE= tox13 14 ext-test:20 unmodified lines