Commit Graph

36 Commits

Author SHA1 Message Date
David Lord 0a00e1b608
use tmp_path instead of tmpdir 2023-05-02 10:38:27 -07:00
AntoineMath b10b6d4af1
add text parameter to config.from_file 2023-02-23 11:10:21 -08:00
David Lord bfdd37110c
deprecate config attributes 2022-08-01 16:58:55 -07:00
Stanislav Bushuev 3ecebcdf8d Add test config.from_mapping method: ignoring items with non-upper keys 2022-05-31 17:51:39 +02:00
David Lord ef6c2b9e4a
clean up pytest.raises tests 2022-04-28 09:32:31 -07:00
David Lord e75d575361
windows env vars are uppercase 2022-03-25 12:07:45 -07:00
David Lord 4eb5e9455b
more from_prefixed_env features
* support nested dict access with "__" separator
* don't specify separator in prefix
* catch exceptions for any loads function
2022-03-25 11:54:45 -07:00
pgjones 08a283af5e
Allow loading of environment variables into the config
This new method will pick out any environment variables with a certain
prefix and place them into the config named without the prefix. This
makes it easy to use environment variables to configure the app as is
now more popular than when Flask started.

The prefix should ensure that the environment isn't polluted and the
config isn't polluted by environment variables.

I've followed the dynaconf convention of trying to parse the
environment variable and then falling back to the raw value if parsing
fails.
2022-03-25 11:54:03 -07:00
David Lord f2f027d1fb
remove unused module docstrings 2020-04-04 12:28:08 -07:00
David Lord 2ae740dd49
f-strings everywhere 2020-04-04 12:10:00 -07:00
David Lord 524fd0bc8c
apply pyupgrade 2020-04-04 12:10:00 -07:00
David Lord 662c245795
remove _compat module 2020-04-04 12:10:00 -07:00
pgjones 829aa65e64
Support loading configuration from text files
TOML is a very popular format now, and is taking hold in the Python
ecosystem via pyproject.toml (among others). This allows toml config
files via,

    app.config.from_file("config.toml", toml.loads)

it also allows for any other file format whereby there is a loader
that takes a string and returns a mapping.
2019-10-18 09:15:47 -07:00
David Lord 1351d0a565
Merge branch '1.0.x' 2019-06-23 16:57:52 -07:00
David Lord e666f7a69c
standardize license and copyright 2019-06-22 13:09:09 -07:00
David Lord 53c893b646
fix string concats left over by black 2019-06-01 09:22:20 -07:00
David Lord 43483683b2
apply reorder-python-imports pre-commit config 2019-06-01 09:07:20 -07:00
Jon S. Stumpf b46f5942a5
address flake8 issues 2019-06-01 06:31:35 -07:00
David Baumgold 025589ee76 Reformat with black
https://github.com/python/black
2019-05-06 16:28:58 -04:00
David Lord 310fbfcf64
revert copyright year to project start
add copyright header to files
2018-02-08 12:43:30 -08:00
David Lord 465922e5f1
clean up secret key docs
consistent key across docs and examples
consistent key across tests, set in conftest
2017-06-28 07:58:06 -07:00
Markus Unterwaditzer 789715adb9 Fix config.from_pyfile on Python 3 (#2123)
* Fix config.from_pyfile on Python 3

Fix #2118

* Support Python 2.6

* Fix tests on Python 2
2016-12-26 03:50:47 +01:00
Reuven 4dc2ef19ea Use pytest.raises() instead of try/catch with asser 0
This is somehow more readable, and enable using the features of pytest's ExeptionInfo (such as errisinstance).
2016-03-04 13:30:40 +02:00
Timo Furrer d526932a09 support timedelta for SEND_FILE_MAX_AGE_DEFAULT config variable 2015-10-24 07:04:23 +02:00
Parkayun 33534bb4a9 Happy New Year 2015 2015-01-02 11:35:00 +09:00
defuz 5e8d503098 add tests for trim_namespace argument of app.config.get_namespace 2014-10-24 13:11:10 +04:00
Markus Unterwaditzer be42d5665e Split instance tests off into own file 2014-09-11 22:09:52 +02:00
Markus Unterwaditzer 77d887526d Rename fixture apps_tmpdir 2014-09-11 22:09:52 +02:00
Markus Unterwaditzer af4cb0ff2b Remove flask superclass 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer af41dbe0c4 Remove useless classes 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer 5da2c00419 Rewrite assertion methods 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer b1c0951ad6 Move fixtures 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer ba82bac3d8 Rework test_config 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer df711eac90 Some fixes 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer 8fa5e32d9a Tests pass now. 2014-09-11 22:09:50 +02:00
Markus Unterwaditzer 961db8ad72 Made tests recognizable 2014-09-11 22:09:50 +02:00