Skip to content

Commit 5f00937

Browse files
wgwzuntitaker
authored andcommitted
Update minitwit & improve testing for examples (pallets#1954)
* Update minitwit & improve testing for examples * Related to pallets#1945 * Re-works minitwit to be installed and run as: pip install --editable . export FLASK_APP=minitwit.minitwit export FLASK_DEBUG=1 flask initdb flask run * added flaskr and minitwit to norecursedirs * tests not properly run when using pytest standards * see: http://stackoverflow.com/questions/38313171/configuring-pytest-with-installable-examples-in-a-project * Both flaskr and minitwit now follow pytest standards. * Tests can for them as `py.test` or `python setup.py test` * Update minitwit readme * updates the instructions for running * Fixes for updating the minitwit example - This reverts the changes to the *docs/* (I will file separate PR). - Running the app is now: `export FLASK_APP=minitwit` & `flask run` (After installing the app) * Remove unnecessary comma from flaskr/setup.py
1 parent 1e5746b commit 5f00937

File tree

17 files changed

+29
-11
lines changed

17 files changed

+29
-11
lines changed

examples/flaskr/tests/context.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/flaskr/tests/test_flaskr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
:license: BSD, see LICENSE for more details.
1010
"""
1111

12-
import pytest
1312
import os
1413
import tempfile
14+
import pytest
15+
from flaskr import flaskr
1516

16-
from context import flaskr
1717

1818
@pytest.fixture
1919
def client(request):

examples/minitwit/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minitwit.db
2+
.eggs/

examples/minitwit/MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
graft minitwit/templates
2+
graft minitwit/static
3+
include minitwit/schema.sql

examples/minitwit/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131

3232
~ Is it tested?
3333

34-
You betcha. Run the `test_minitwit.py` file to
34+
You betcha. Run the `python setup.py test` file to
3535
see the tests pass.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from minitwit import app
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)