Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b3e616cf9 | ||
|
|
bf2b2f25f9 | ||
|
|
a1cd92e459 | ||
|
|
218178164f | ||
|
|
2e83bd1f50 |
5 changed files with 41 additions and 8 deletions
11
CHANGES
11
CHANGES
|
|
@ -8,6 +8,17 @@ Version 0.4
|
|||
|
||||
Release date to be announced, codename to be selected.
|
||||
|
||||
Version 0.3.1
|
||||
-------------
|
||||
|
||||
Bugfix release, released May 28th
|
||||
|
||||
- fixed a error reporting bug with :meth:`flask.Config.from_envvar`
|
||||
- removed some unused code from flask
|
||||
- release does no longer include development leftover files (.git
|
||||
folder for themes, built documentation in zip and pdf file and
|
||||
some .pyc files)
|
||||
|
||||
Version 0.3
|
||||
-----------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
include Makefile CHANGES LICENSE AUTHORS
|
||||
recursive-include tests *
|
||||
recursive-include examples *
|
||||
recursive-include docs *
|
||||
prune docs/_build/doctrees
|
||||
recursive-exclude docs *.pyc
|
||||
recursive-exclude docs *.pyo
|
||||
recursive-exclude examples *.pyc
|
||||
recursive-exclude examples *.pyo
|
||||
prune docs/_build
|
||||
prune docs/_themes/.git
|
||||
|
|
|
|||
8
flask.py
8
flask.py
|
|
@ -698,7 +698,8 @@ class Config(dict):
|
|||
raise RuntimeError('The environment variable %r is not set '
|
||||
'and as such configuration could not be '
|
||||
'loaded. Set this variable and make it '
|
||||
'point to a configuration file')
|
||||
'point to a configuration file' %
|
||||
variable_name)
|
||||
self.from_pyfile(rv)
|
||||
return True
|
||||
|
||||
|
|
@ -1423,8 +1424,3 @@ current_app = LocalProxy(lambda: _request_ctx_stack.top.app)
|
|||
request = LocalProxy(lambda: _request_ctx_stack.top.request)
|
||||
session = LocalProxy(lambda: _request_ctx_stack.top.session)
|
||||
g = LocalProxy(lambda: _request_ctx_stack.top.g)
|
||||
|
||||
|
||||
# script interface to run a development server
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main(sys.argv))
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -43,7 +43,7 @@ from setuptools import setup
|
|||
|
||||
setup(
|
||||
name='Flask',
|
||||
version='0.4',
|
||||
version='0.3.1',
|
||||
url='http://github.com/mitsuhiko/flask/',
|
||||
license='BSD',
|
||||
author='Armin Ronacher',
|
||||
|
|
|
|||
|
|
@ -717,6 +717,26 @@ class ConfigTestCase(unittest.TestCase):
|
|||
app.config.from_object(Test)
|
||||
self.common_object_test(app)
|
||||
|
||||
def test_config_from_envvar(self):
|
||||
import os
|
||||
env = os.environ
|
||||
try:
|
||||
os.environ = {}
|
||||
app = flask.Flask(__name__)
|
||||
try:
|
||||
app.config.from_envvar('FOO_SETTINGS')
|
||||
except RuntimeError, e:
|
||||
assert "'FOO_SETTINGS' is not set" in str(e)
|
||||
else:
|
||||
assert 0, 'expected exception'
|
||||
not app.config.from_envvar('FOO_SETTINGS', silent=True)
|
||||
|
||||
os.environ = {'FOO_SETTINGS': 'flask_tests.py'}
|
||||
assert app.config.from_envvar('FOO_SETTINGS')
|
||||
self.common_object_test(app)
|
||||
finally:
|
||||
os.environ = env
|
||||
|
||||
|
||||
def suite():
|
||||
from minitwit_tests import MiniTwitTestCase
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue