From ac04bc78361d5562f8289e8efe16a2e9a97b0d01 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 26 May 2013 20:33:22 +0200 Subject: [PATCH] replace 1/0 by 1 // 0 to get rid of DeprecationWarning (and PEP8 issue) --- flask/testsuite/basic.py | 6 +++--- flask/testsuite/helpers.py | 10 +++++----- flask/testsuite/signals.py | 2 +- flask/testsuite/subclassing.py | 2 +- flask/testsuite/testing.py | 2 +- flask/testsuite/views.py | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/flask/testsuite/basic.py b/flask/testsuite/basic.py index 9bbe10e3..a172ed85 100644 --- a/flask/testsuite/basic.py +++ b/flask/testsuite/basic.py @@ -529,7 +529,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): pass @app.route('/') def fails(): - 1/0 + 1 // 0 rv = app.test_client().get('/') self.assert_equal(rv.status_code, 500) self.assert_in(b'Internal Server Error', rv.data) @@ -866,7 +866,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): app = flask.Flask(__name__) @app.route('/') def index(): - 1/0 + 1 // 0 c = app.test_client() if config_key is not None: app.config[config_key] = True @@ -1054,7 +1054,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): @app.route('/fail') def fail_func(): - 1/0 + 1 // 0 c = app.test_client() for x in range(3): diff --git a/flask/testsuite/helpers.py b/flask/testsuite/helpers.py index 90e9e020..2b04f73a 100644 --- a/flask/testsuite/helpers.py +++ b/flask/testsuite/helpers.py @@ -306,7 +306,7 @@ class LoggingTestCase(FlaskTestCase): @app.route('/exc') def exc(): - 1/0 + 1 // 0 with app.test_client() as c: with catch_stderr() as err: @@ -340,7 +340,7 @@ class LoggingTestCase(FlaskTestCase): @app.route('/') def index(): - 1/0 + 1 // 0 rv = app.test_client().get('/') self.assert_equal(rv.status_code, 500) @@ -349,7 +349,7 @@ class LoggingTestCase(FlaskTestCase): err = out.getvalue() self.assert_in('Exception on / [GET]', err) self.assert_in('Traceback (most recent call last):', err) - self.assert_in('1/0', err) + self.assert_in('1 // 0', err) self.assert_in('ZeroDivisionError:', err) def test_processor_exceptions(self): @@ -357,11 +357,11 @@ class LoggingTestCase(FlaskTestCase): @app.before_request def before_request(): if trigger == 'before': - 1/0 + 1 // 0 @app.after_request def after_request(response): if trigger == 'after': - 1/0 + 1 // 0 return response @app.route('/') def index(): diff --git a/flask/testsuite/signals.py b/flask/testsuite/signals.py index ffd575c1..94262f17 100644 --- a/flask/testsuite/signals.py +++ b/flask/testsuite/signals.py @@ -83,7 +83,7 @@ class SignalsTestCase(FlaskTestCase): @app.route('/') def index(): - 1/0 + 1 // 0 def record(sender, exception): recorded.append(exception) diff --git a/flask/testsuite/subclassing.py b/flask/testsuite/subclassing.py index dbfdd499..6b81db98 100644 --- a/flask/testsuite/subclassing.py +++ b/flask/testsuite/subclassing.py @@ -30,7 +30,7 @@ class FlaskSubclassingTestCase(FlaskTestCase): @app.route('/') def index(): - 1/0 + 1 // 0 rv = app.test_client().get('/') self.assert_equal(rv.status_code, 500) diff --git a/flask/testsuite/testing.py b/flask/testsuite/testing.py index cd96b497..a618f0b8 100644 --- a/flask/testsuite/testing.py +++ b/flask/testsuite/testing.py @@ -143,7 +143,7 @@ class TestToolsTestCase(FlaskTestCase): @app.route('/other') def other(): - 1/0 + 1 // 0 with app.test_client() as c: resp = c.get('/') diff --git a/flask/testsuite/views.py b/flask/testsuite/views.py index 9dd463f2..4eee015b 100644 --- a/flask/testsuite/views.py +++ b/flask/testsuite/views.py @@ -55,9 +55,9 @@ class ViewTestCase(FlaskTestCase): class Index(flask.views.MethodView): def get(self): - 1/0 + 1 // 0 def post(self): - 1/0 + 1 // 0 class Other(Index): def get(self):