Merge pull request #747 from ThomasWaldmann/sprint-branch
Before adoption: this commit came in with the history the project adopted, so no landing records it.
replace 1/0 by 1 // 0 to get rid of DeprecationWarning (and PEP8 issue)
authored by Daniel Neuhäuser · committed by Daniel Neuhäuser · parents bb2e20f, ac04bc7 · Browse files · 6 files·+13 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+13 added−13 removed
- other:+13 added−13 removed
Provenance
- Commit
915d718- Tree
10d4507- Author
Daniel Neuhäuser <dasdasich@gmail.com>- Committer
Daniel Neuhäuser <dasdasich@gmail.com>- Parent 1
bb2e20f- Parent 2
ac04bc7
6 files changed+13 added−13 removed
modified:flask/testsuite/basic.py+3 added-3 removed
527 unmodified lines528 except:529 pass530 @app.route('/')531 def fails():532- 1/0532+ 1 // 0533 rv = app.test_client().get('/')534 self.assert_equal(rv.status_code, 500)535 self.assert_in(b'Internal Server Error', rv.data)536 self.assert_equal(len(called), 2)328 unmodified lines865 def apprunner(configkey):866 app = flask.Flask(__name__)867 @app.route('/')868 def index():869- 1/0869+ 1 // 0870 c = app.test_client()871 if config_key is not None:872 app.config[config_key] = True873 try:179 unmodified lines1053 app.debug = True1054 1055 @app.route('/fail')1056 def fail_func():1057- 1/01057+ 1 // 01058 1059 c = app.test_client()1060 for x in range(3):1061 with self.assert_raises(ZeroDivisionError):89 unmodified linesmodified:flask/testsuite/helpers.py+5 added-5 removed
304 unmodified lines305 return ''306 307 @app.route('/exc')308 def exc():309- 1/0309+ 1 // 0310 311 with app.test_client() as c:312 with catch_stderr() as err:313 c.get('/')25 unmodified lines339 app.logger.addHandler(StreamHandler(out))340 341 @app.route('/')342 def index():343- 1/0343+ 1 // 0344 345 rv = app.test_client().get('/')346 self.assert_equal(rv.status_code, 500)347 self.assert_in(b'Internal Server Error', rv.data)348 349 err = out.getvalue()350 self.assert_in('Exception on / [GET]', err)351 self.assert_in('Traceback (most recent call last):', err)352- self.assert_in('1/0', err)352+ self.assert_in('1 // 0', err)353 self.assert_in('ZeroDivisionError:', err)354 355 def test_processor_exceptions(self):356 app = flask.Flask(__name__)357 @app.before_request358 def before_request():359 if trigger == 'before':360- 1/0360+ 1 // 0361 @app.after_request362 def after_request(response):363 if trigger == 'after':364- 1/0364+ 1 // 0365 return response366 @app.route('/')367 def index():368 return 'Foo'152 unmodified linesmodified:flask/testsuite/signals.py+1 added-1 removed
81 unmodified lines82 recorded = []83 84 @app.route('/')85 def index():86- 1/086+ 1 // 087 88 def record(sender, exception):89 recorded.append(exception)90 39 unmodified linesmodified:flask/testsuite/subclassing.py+1 added-1 removed
28 unmodified lines29 app.logger.addHandler(StreamHandler(out))30 31 @app.route('/')32 def index():33- 1/033+ 1 // 034 35 rv = app.test_client().get('/')36 self.assert_equal(rv.status_code, 500)37 self.assert_in(b'Internal Server Error', rv.data)9 unmodified linesmodified:flask/testsuite/testing.py+1 added-1 removed
141 unmodified lines142 return 'Hello World!'143 144 @app.route('/other')145 def other():146- 1/0146+ 1 // 0147 148 with app.test_client() as c:149 resp = c.get('/')150 self.assert_equal(flask.g.value, 42)92 unmodified linesmodified:flask/testsuite/views.py+2 added-2 removed
53 unmodified lines54 app = flask.Flask(__name__)55 56 class Index(flask.views.MethodView):57 def get(self):58- 1/058+ 1 // 059 def post(self):60- 1/060+ 1 // 061 62 class Other(Index):63 def get(self):64 return 'GET'105 unmodified lines