Skip to content

Commit

Permalink
doc(testing): Clarify 'myapp' example code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt Griffiths committed Aug 17, 2016
1 parent f672670 commit a6672ee
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions falcon/testing/__init__.py
Expand Up @@ -24,13 +24,17 @@
# -----------------------------------------------------------------
from falcon import testing
from myapp import api
import myapp
class MyTestCase(testing.TestCase):
def setUp(self):
super(MyTestCase, self).setUp()
self.app = api.create()
# Assume the hypothetical `myapp` package has a
# function called `create()` to initialize and
# return a `falcon.API` instance.
self.app = myapp.create()
class TestMyApp(MyTestCase):
Expand All @@ -48,12 +52,15 @@ def test_get_message(self):
from falcon import testing
import pytest
from myapp import api
import myapp
@pytest.fixture(scope='module')
def client():
return testing.TestClient(api.create())
# Assume the hypothetical `myapp` package has a
# function called `create()` to initialize and
# return a `falcon.API` instance.
return testing.TestClient(myapp.create())
def test_get_message(client):
Expand Down

0 comments on commit a6672ee

Please sign in to comment.