Skip to content
Myr

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

3 files+15 added−14 removed

modified:tests/flask_tests.py+11 added-12 removed
13 unmodified lines
14import re15import sys16import flask17import unittest18import tempfile18from logging import StreamHandler19from contextlib import contextmanager20from datetime import datetime22from werkzeug import parse_date, parse_options_header, http_date21from werkzeug import parse_date, parse_options_header22from werkzeug.exceptions import NotFound23from jinja2 import TemplateNotFound24from cStringIO import StringIO25
324 unmodified lines
350 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 lines
636 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 lines
678 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 lines
717 @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 lines
792 with app.test_request_context():793 f = app.view_functions['admin.static']794795 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 lines
912 1/0913 c = app.test_client()914915 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 out
175 unmodified lines
1096 recorded.append((template, context))10971098 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'] == 42
86 unmodified lines
modified:tests/flaskext_test.py-1 removed
16 unmodified lines
17import urllib218import tempfile19import subprocess20import argparse21from cStringIO import StringIO2122from flask import json2324from setuptools.package_index import PackageIndex
286 unmodified lines
modified:Makefile+4 added-1 removed
1.PHONY: clean-pyc ext-test test upload-docs docs1.PHONY: clean-pyc ext-test test upload-docs docs audit23all: clean-pyc test45test:6 python setup.py test78audit:9 python setup.py audit1011tox-test:12 PYTHONDONTWRITEBYTECODE= tox1314ext-test:
20 unmodified lines