Skip to content
Myr

Merge branch 'master' of https://github.com/Xion/flask into Xion-master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Conflicts: flask/testsuite/config.py

authored by Daniel Neuhäuser · committed by Daniel Neuhäuser · parents 9741129, ec5b182 · Browse files · 3 files+23 added−1 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+23 added−1 removed

  • other:+23 added−1 removed

3 files+23 added−1 removed

modified:flask/testsuite/__init__.py+3 added
155 unmodified lines
156157 def assert_not_in(self, x, y):158 self.assertNotIn(x, y)159160 def assert_isinstance(self, obj, cls):161 self.assertIsInstance(obj, cls)162163 if sys.version_info[:2] == (2, 6):164 def assertIn(self, x, y):165 assert x in y, "%r unexpectedly not in %r" % (x, y)166
83 unmodified lines
modified:flask/testsuite/config.py+10 added
117 unmodified lines
118 else:119 self.assert_true(0, 'expected config')120 self.assert_false(app.config.from_json('missing.json', silent=True))121122 def test_custom_config_class(self):123 class Config(flask.Config):124 pass125 class Flask(flask.Flask):126 config_class = Config127 app = Flask(__name__)128 self.assert_isinstance(app.config, Config)129 app.config.from_object(__name__)130 self.common_object_test(app)131132 def test_session_lifetime(self):133 app = flask.Flask(__name__)134 app.config['PERMANENT_SESSION_LIFETIME'] = 42135 self.assert_equal(app.permanent_session_lifetime.seconds, 42)
206 unmodified lines
modified:flask/app.py+10 added-1 removed
173 unmodified lines
174 request_globals_class = property(_get_request_globals_class,175 _set_request_globals_class)176 del _get_request_globals_class, _set_request_globals_class177178 #: The class that is used for the ``config`` attribute of this app.179 #: Defaults to :class:`~flask.Config`.180 #:181 #: Example use cases for a custom class:182 #:183 #: 1. Default values for certain config options.184 #: 2. Access to config values through attributes in addition to keys.185 config_class = Config186187 #: The debug flag. Set this to `True` to enable debugging of the188 #: application. In debug mode the debugger will kick in when an unhandled189 #: exception occurs and the integrated server will automatically reload190 #: the application if changes in the code are detected.
427 unmodified lines
618 """619 root_path = self.root_path620 if instance_relative:621 root_path = self.instance_path613 return Config(root_path, self.default_config)622 return self.config_class(root_path, self.default_config)623624 def auto_find_instance_path(self):625 """Tries to locate the instance path if it was not provided to the626 constructor of the application class. It will basically calculate
1229 unmodified lines