Skip to content

Commit 915d718

Browse files
committed
Merge pull request pallets#747 from ThomasWaldmann/sprint-branch
replace 1/0 by 1 // 0 to get rid of DeprecationWarning (and PEP8 issue)
2 parents bb2e20f + ac04bc7 commit 915d718

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

flask/testsuite/basic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def teardown_request2(exc):
529529
pass
530530
@app.route('/')
531531
def fails():
532-
1/0
532+
1 // 0
533533
rv = app.test_client().get('/')
534534
self.assert_equal(rv.status_code, 500)
535535
self.assert_in(b'Internal Server Error', rv.data)
@@ -866,7 +866,7 @@ def apprunner(configkey):
866866
app = flask.Flask(__name__)
867867
@app.route('/')
868868
def index():
869-
1/0
869+
1 // 0
870870
c = app.test_client()
871871
if config_key is not None:
872872
app.config[config_key] = True
@@ -1054,7 +1054,7 @@ def test_preserve_only_once(self):
10541054

10551055
@app.route('/fail')
10561056
def fail_func():
1057-
1/0
1057+
1 // 0
10581058

10591059
c = app.test_client()
10601060
for x in range(3):

flask/testsuite/helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def index():
306306

307307
@app.route('/exc')
308308
def exc():
309-
1/0
309+
1 // 0
310310

311311
with app.test_client() as c:
312312
with catch_stderr() as err:
@@ -340,7 +340,7 @@ def test_exception_logging(self):
340340

341341
@app.route('/')
342342
def index():
343-
1/0
343+
1 // 0
344344

345345
rv = app.test_client().get('/')
346346
self.assert_equal(rv.status_code, 500)
@@ -349,19 +349,19 @@ def index():
349349
err = out.getvalue()
350350
self.assert_in('Exception on / [GET]', err)
351351
self.assert_in('Traceback (most recent call last):', err)
352-
self.assert_in('1/0', err)
352+
self.assert_in('1 // 0', err)
353353
self.assert_in('ZeroDivisionError:', err)
354354

355355
def test_processor_exceptions(self):
356356
app = flask.Flask(__name__)
357357
@app.before_request
358358
def before_request():
359359
if trigger == 'before':
360-
1/0
360+
1 // 0
361361
@app.after_request
362362
def after_request(response):
363363
if trigger == 'after':
364-
1/0
364+
1 // 0
365365
return response
366366
@app.route('/')
367367
def index():

flask/testsuite/signals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_request_exception_signal(self):
8383

8484
@app.route('/')
8585
def index():
86-
1/0
86+
1 // 0
8787

8888
def record(sender, exception):
8989
recorded.append(exception)

flask/testsuite/subclassing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def log_exception(self, exc_info):
3030

3131
@app.route('/')
3232
def index():
33-
1/0
33+
1 // 0
3434

3535
rv = app.test_client().get('/')
3636
self.assert_equal(rv.status_code, 500)

flask/testsuite/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def index():
143143

144144
@app.route('/other')
145145
def other():
146-
1/0
146+
1 // 0
147147

148148
with app.test_client() as c:
149149
resp = c.get('/')

flask/testsuite/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def test_view_patching(self):
5555

5656
class Index(flask.views.MethodView):
5757
def get(self):
58-
1/0
58+
1 // 0
5959
def post(self):
60-
1/0
60+
1 // 0
6161

6262
class Other(Index):
6363
def get(self):

0 commit comments

Comments
 (0)