Commit Graph

12 Commits

Author SHA1 Message Date
Dosenpfand 6af24f5f44 Do not explicitly set SQLALCHEMY_TRACK_MODIFICATIONS for test/example 2022-10-28 11:28:50 +02:00
Dosenpfand 9e03576c94 Keep config for flask_sqlalchemy < 3 2022-10-24 19:35:47 +02:00
Dosenpfand bfa48c5a2c Add support for flask_sqlalchemy >= 3.0.0 2022-10-24 18:59:28 +02:00
Jeff Widman 70abd78e55 Setup DB properly
When I switched over to `flask run` entrypoint in b92391d177,
I forgot that the `if name==__main__` code no longer triggers.
So the SQLite in-memory database wasn't getting created for the example
app.

This moves the DB creation to a werkzeug/Flask hook that runs before the
first request to the app, so that the DB table is created when we query
it.

Also updated the test which worked fine previously, but this is more
idiomatic.
2020-03-09 10:01:59 -07:00
Jeff Widman b92391d177 Switch to Flask's native CLI
Drop `flask_script` in favor of Flask's native CLI:
* https://flask.palletsprojects.com/en/master/cli/

This also requires changing the tests so that `pytest` mocks the env var
`FLASK_ENV` so that the test app starts in development mode. Unlike
normal test apps, we _do_ want development/debug mode, in addition to
testing mode.
2020-02-17 23:57:04 -08:00
Jeff Widman 9c7db48362 Explicitly disable SQLALCHEMY_TRACK_MODIFICATIONS
This silences deprecation warnings.
Background: https://stackoverflow.com/a/33790196/770425

Note: This code can be removed once `flask_sqlalchemy` 3.0 ships, or any
release that includes
https://github.com/pallets/flask-sqlalchemy/pull/727.
2020-02-17 21:36:01 -08:00
Jeff Widman 9f2c353e86 Trivial imports cleanup 2017-02-12 02:31:26 -08:00
Matt Good 14cd912df7 Fix style errors and add to automated checks
Adds a "stylecheck" to the Tox build config to automatically run flake8 checks.
Fixes existing flake8 issues.
2015-04-17 14:23:58 -07:00
Matt Good ffbdf0f563 Add SQLAlchemy to test app 2013-12-31 17:55:19 -05:00
Ivan Ivaschenko 903ed85f00 remove coding:utf-8 and add some style fixes 2013-11-29 00:17:15 +02:00
Ivan Ivaschenko 5710314252 pep8 formatting + coding: utf8 2013-11-28 18:31:29 +02:00
Matt Good d5987410d1 Add basic sanity test 2013-11-06 09:00:05 -08:00